summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/mingw.mk19
-rw-r--r--make/msvc.mk17
2 files changed, 32 insertions, 4 deletions
diff --git a/make/mingw.mk b/make/mingw.mk
index ae599393..14bfdff8 100644
--- a/make/mingw.mk
+++ b/make/mingw.mk
@@ -33,8 +33,23 @@ define c_compile
-c $(1) -o $(call c_src_to_obj,$(1))
endef
-libcompile = $(compile)
-c_libcompile = $(c_compile)
+# 1 2
+# Usage: $(call libcompile,src,includes)
+define libcompile
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DDLL_EXPORT \
+ $(call depflags,$(basename $(call src_to_obj,$(1)))) \
+ $(foreach I,$(2),-I$(I)) \
+ -c $(1) -o $(call src_to_obj,$(1))
+endef
+
+# 1 2
+# Usage: $(call c_libcompile,src,includes)
+define c_libcompile
+ $(CC) $(CPPFLAGS) $(CFLAGS) -DDLL_EXPORT \
+ $(call depflags,$(basename $(call src_to_obj,$(1)))) \
+ $(foreach I,$(2),-I$(I)) \
+ -c $(1) -o $(call c_src_to_obj,$(1))
+endef
# 1 2
# Usage: $(call makeslib,objs,library)
diff --git a/make/msvc.mk b/make/msvc.mk
index b7b1d572..eb6c6ac7 100644
--- a/make/msvc.mk
+++ b/make/msvc.mk
@@ -40,8 +40,21 @@ define c_compile
/c $(1) /Fo$(call c_src_to_obj,$(1))
endef
-libcompile = $(compile)
-c_libcompile = $(c_compile)
+# 1 2
+# Usage: $(call libcompile,src,includes)
+define libcompile
+ cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
+ -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \
+ /c $(1) /Fo$(call src_to_obj,$(1))
+endef
+
+# 1 2
+# Usage: $(call c_libcompile,src,includes)
+define c_libcompile
+ cl /nologo /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \
+ -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \
+ /c $(1) /Fo$(call c_src_to_obj,$(1))
+endef
# 1 2
# Usage: $(call makeslib,objs,library)