2009-10-10 14:22:49 +00:00
|
|
|
# --- Required interface definitions ---
|
|
|
|
|
|
|
|
OBJ=o
|
|
|
|
LOBJ=o
|
|
|
|
|
|
|
|
# Usage: $(call libname,base)
|
|
|
|
define libname
|
2018-08-14 20:28:52 +00:00
|
|
|
lib$(1).dll.a
|
2009-10-10 14:22:49 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
# Usage: $(call binname,base)
|
|
|
|
define binname
|
2009-10-10 17:03:52 +00:00
|
|
|
$(1).exe
|
2009-10-10 14:22:49 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
# --- Required rule definitions ---
|
|
|
|
|
2019-01-14 02:29:12 +00:00
|
|
|
# 1 2 3
|
|
|
|
# Usage: $(call compile,src,includes,xflags)
|
2009-10-10 14:22:49 +00:00
|
|
|
define compile
|
2019-01-14 02:29:12 +00:00
|
|
|
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(3) \
|
2009-10-10 14:22:49 +00:00
|
|
|
$(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_compile,src,includes)
|
|
|
|
define c_compile
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) \
|
|
|
|
$(call depflags,$(basename $(call src_to_obj,$(1)))) \
|
|
|
|
$(foreach I,$(2),-I$(I)) \
|
|
|
|
-c $(1) -o $(call c_src_to_obj,$(1))
|
|
|
|
endef
|
|
|
|
|
2009-10-21 01:45:13 +00:00
|
|
|
# 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
|
2009-10-10 14:22:49 +00:00
|
|
|
|
2009-10-10 15:28:33 +00:00
|
|
|
# 1 2
|
|
|
|
# Usage: $(call makeslib,objs,library)
|
|
|
|
define makeslib
|
|
|
|
$(RM) $2
|
2009-10-10 15:32:59 +00:00
|
|
|
$(AR) cru $(2) $(1)
|
|
|
|
$(RANLIB) $(2)
|
2009-10-10 15:28:33 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-11 00:24:22 +00:00
|
|
|
# 1 2 3 4 5 6 7
|
|
|
|
# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age)
|
2009-10-10 14:22:49 +00:00
|
|
|
define makelib
|
2018-08-14 20:28:52 +00:00
|
|
|
$(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \
|
|
|
|
$(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll \
|
2009-10-11 00:24:22 +00:00
|
|
|
$(1) $(3) $(4)
|
2009-10-10 14:22:49 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-11 00:24:22 +00:00
|
|
|
# 1 2 3 4
|
|
|
|
# Usage: $(call makebin,objs,binary,ldflags,libs)
|
2009-10-10 14:22:49 +00:00
|
|
|
define makebin
|
2009-10-11 03:19:34 +00:00
|
|
|
$(CXX) $(CXXFLAGS) $(1) -o $(2) $(3) $(4)
|
2009-10-10 14:22:49 +00:00
|
|
|
endef
|
2009-10-22 15:20:41 +00:00
|
|
|
|
|
|
|
# Install target
|
|
|
|
|
2012-06-21 18:06:54 +00:00
|
|
|
INSTALL_DIR = install-mingw$(WINDOWS_WORDSIZE)
|
2009-10-22 15:20:41 +00:00
|
|
|
include make/installwin.mk
|
|
|
|
install: installwin
|
2012-06-21 18:06:54 +00:00
|
|
|
$(STRIP) $(DEST)/bin/*.exe
|
|
|
|
$(STRIP) $(DEST)/bin/*.dll
|