Commit 64a890db2bfa0e02cbb1458c7e52ed78f1c0b8b8
1 parent
28c122b1
msvc -- not tested
git-svn-id: svn+q:///qpdf/trunk@774 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing
1 changed file
with
68 additions
and
0 deletions
make/msvc.mk
0 → 100644
| 1 | +# --- Required interface definitions --- | ||
| 2 | + | ||
| 3 | +OBJ=obj | ||
| 4 | +LOBJ=obj | ||
| 5 | + | ||
| 6 | +# Usage: $(call libname,base) | ||
| 7 | +define libname | ||
| 8 | +$(1).lib | ||
| 9 | +endef | ||
| 10 | + | ||
| 11 | +# Usage: $(call binname,base) | ||
| 12 | +define binname | ||
| 13 | +$(1).exe | ||
| 14 | +endef | ||
| 15 | + | ||
| 16 | +# --- Required rule definitions --- | ||
| 17 | + | ||
| 18 | +# 1 2 | ||
| 19 | +# Usage: $(call compile,src,includes) | ||
| 20 | +define compile | ||
| 21 | + cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \ | ||
| 22 | + $(foreach I,$(2),-I$(I)) \ | ||
| 23 | + /c $(1) /Fo$(call src_to_obj,$(1)) | ||
| 24 | +endef | ||
| 25 | + | ||
| 26 | +# 1 2 | ||
| 27 | +# Usage: $(call c_compile,src,includes) | ||
| 28 | +define c_compile | ||
| 29 | + cl /nologo /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \ | ||
| 30 | + $(foreach I,$(2),-I$(I)) \ | ||
| 31 | + /c $(1) /Fo$(call src_to_obj,$(1)) | ||
| 32 | +endef | ||
| 33 | + | ||
| 34 | +libcompile = $(compile) | ||
| 35 | +c_libcompile = $(c_compile) | ||
| 36 | + | ||
| 37 | +# 1 2 | ||
| 38 | +# Usage: $(call makeslib,objs,library) | ||
| 39 | +define makeslib | ||
| 40 | + lib /nologo /OUT:$(2) $(1) | ||
| 41 | +endef | ||
| 42 | + | ||
| 43 | +# 1 2 3 4 5 | ||
| 44 | +# Usage: $(call makelib,objs,library,current,revision,age) | ||
| 45 | +define makelib | ||
| 46 | + dll= | ||
| 47 | + cl /nologo /Zi /Gy /EHsc /MD /TP /GR /LD /Fe$(basename $(2))$(3).dll \ | ||
| 48 | + /link /incremental:no \ | ||
| 49 | + $(foreach L,$(subst -L,,$(LDFLAGS)),/LIBPATH:$(L)) \ | ||
| 50 | + $(foreach L,$(subst -l,,$(LIBS)),$(L).lib) $(1) | ||
| 51 | + if [ -f $(basename $(2))$(3).dll.manifest ]; then \ | ||
| 52 | + mt.exe -nologo -manifest $(basename $(2))$(3).dll.manifest \ | ||
| 53 | + -outputresource:$(basename $(2))$(3).dll\;2; \ | ||
| 54 | + fi | ||
| 55 | +endef | ||
| 56 | + | ||
| 57 | +# 1 2 | ||
| 58 | +# Usage: $(call makebin,objs,binary) | ||
| 59 | +define makebin | ||
| 60 | + cl /nologo /Zi /Gy /EHsc /MD /TP /GR /OUT:$(2) \ | ||
| 61 | + /link /incremental:no \ | ||
| 62 | + $(foreach L,$(subst -L,,$(LDFLAGS)),/LIBPATH:$(L)) \ | ||
| 63 | + $(foreach L,$(subst -l,,$(LIBS)),$(L).lib) $(1) | ||
| 64 | + if [ -f $(2).manifest ]; then \ | ||
| 65 | + mt.exe -nologo -manifest $(2).manifest \ | ||
| 66 | + -outputresource:$(2)\;2; \ | ||
| 67 | + fi | ||
| 68 | +endef |