2009-10-10 22:58:41 +00:00
|
|
|
# --- Required interface definitions ---
|
|
|
|
|
|
|
|
OBJ=obj
|
|
|
|
LOBJ=obj
|
|
|
|
|
|
|
|
# Usage: $(call libname,base)
|
|
|
|
define libname
|
|
|
|
$(1).lib
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Usage: $(call binname,base)
|
|
|
|
define binname
|
|
|
|
$(1).exe
|
|
|
|
endef
|
|
|
|
|
2009-10-11 01:02:08 +00:00
|
|
|
# --- Local Changes ---
|
|
|
|
|
|
|
|
# Filter out -g
|
|
|
|
CFLAGS := $(filter-out -g,$(CFLAGS))
|
|
|
|
CXXFLAGS := $(filter-out -g,$(CXXFLAGS))
|
|
|
|
|
2009-10-12 02:13:04 +00:00
|
|
|
clean::
|
|
|
|
$(RM) *.pdb
|
|
|
|
|
2009-10-10 22:58:41 +00:00
|
|
|
# --- Required rule definitions ---
|
|
|
|
|
|
|
|
# 1 2
|
|
|
|
# Usage: $(call compile,src,includes)
|
|
|
|
define compile
|
|
|
|
cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
|
|
|
|
$(foreach I,$(2),-I$(I)) \
|
|
|
|
/c $(1) /Fo$(call src_to_obj,$(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
# 1 2
|
|
|
|
# Usage: $(call c_compile,src,includes)
|
|
|
|
define c_compile
|
2009-10-23 03:44:51 +00:00
|
|
|
cl /nologo /O2 /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \
|
2009-10-10 22:58:41 +00:00
|
|
|
$(foreach I,$(2),-I$(I)) \
|
2009-10-11 00:13:28 +00:00
|
|
|
/c $(1) /Fo$(call c_src_to_obj,$(1))
|
2009-10-10 22:58:41 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-21 01:45:13 +00:00
|
|
|
# 1 2
|
|
|
|
# Usage: $(call libcompile,src,includes)
|
|
|
|
define libcompile
|
2009-10-23 03:44:51 +00:00
|
|
|
cl /nologo /O2 /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
|
2009-10-21 01:45:13 +00:00
|
|
|
-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
|
2009-10-23 03:44:51 +00:00
|
|
|
cl /nologo /O2 /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \
|
2009-10-21 01:45:13 +00:00
|
|
|
-DDLL_EXPORT $(foreach I,$(2),-I$(I)) \
|
|
|
|
/c $(1) /Fo$(call c_src_to_obj,$(1))
|
|
|
|
endef
|
2009-10-10 22:58:41 +00:00
|
|
|
|
|
|
|
# 1 2
|
|
|
|
# Usage: $(call makeslib,objs,library)
|
|
|
|
define makeslib
|
|
|
|
lib /nologo /OUT:$(2) $(1)
|
|
|
|
endef
|
|
|
|
|
2009-10-11 01:02:08 +00:00
|
|
|
# 1 2 3 4 5 6 7
|
|
|
|
# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age)
|
2009-10-10 22:58:41 +00:00
|
|
|
define makelib
|
2010-08-08 22:29:49 +00:00
|
|
|
cl /nologo /O2 /Zi /Gy /EHsc /MD /LD /Fe$(basename $(2))$(shell expr $(5) - $(7)).dll $(1) \
|
|
|
|
/link /incremental:no \
|
2009-10-11 01:02:08 +00:00
|
|
|
$(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \
|
2010-08-08 22:29:49 +00:00
|
|
|
$(foreach L,$(subst -l,,$(4)),$(L).lib)
|
|
|
|
if [ -f $(basename $(2))$(shell expr $(5) - $(7)).dll.manifest ]; then \
|
|
|
|
mt.exe -nologo -manifest $(basename $(2))$(shell expr $(5) - $(7)).dll.manifest \
|
|
|
|
-outputresource:$(basename $(2))$(shell expr $(5) - $(7)).dll\;2; \
|
|
|
|
fi
|
|
|
|
mv $(basename $(2))$(shell expr $(5) - $(7)).lib $(2)
|
2009-10-10 22:58:41 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-11 01:02:08 +00:00
|
|
|
# 1 2 3 4
|
|
|
|
# Usage: $(call makebin,objs,binary,ldflags,libs)
|
2009-10-10 22:58:41 +00:00
|
|
|
define makebin
|
2009-10-23 03:44:51 +00:00
|
|
|
cl /nologo /O2 /Zi /Gy /EHsc /MD $(1) \
|
2009-10-11 00:13:28 +00:00
|
|
|
/link /incremental:no /OUT:$(2) \
|
2009-10-11 01:02:08 +00:00
|
|
|
$(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \
|
|
|
|
$(foreach L,$(subst -l,,$(4)),$(L).lib)
|
2009-10-10 22:58:41 +00:00
|
|
|
if [ -f $(2).manifest ]; then \
|
|
|
|
mt.exe -nologo -manifest $(2).manifest \
|
|
|
|
-outputresource:$(2)\;2; \
|
|
|
|
fi
|
|
|
|
endef
|
2009-10-22 15:20:41 +00:00
|
|
|
|
|
|
|
# Install target
|
|
|
|
|
|
|
|
INSTALL_DIR = install-msvc
|
2009-10-22 15:42:09 +00:00
|
|
|
STATIC_LIB_NAME = qpdf.lib
|
2009-10-22 15:20:41 +00:00
|
|
|
include make/installwin.mk
|
|
|
|
install: installwin
|