| 1 | # | 
|---|
| 2 | # Netdrive Samba client plugin | 
|---|
| 3 | # kBuild makefile | 
|---|
| 4 | # Copyright (C) netlabs.org 2003-2008 | 
|---|
| 5 | # See COPYING for license informations | 
|---|
| 6 | # | 
|---|
| 7 | # please define (as env variables or kmk command line) the following variables before starting: | 
|---|
| 8 | # BUILD_PLATFORM = os2 | 
|---|
| 9 | # BUILD_TYPE = release|debug | 
|---|
| 10 | # | 
|---|
| 11 | # Copy Config.km_ to Config.kmk and edit it to match your installation. | 
|---|
| 12 | # | 
|---|
| 13 |  | 
|---|
| 14 | DEPTH = .. | 
|---|
| 15 |  | 
|---|
| 16 | ndpsmb_TOOL = GCC3OMF | 
|---|
| 17 | ndpsmb_RCTOOL = OPENWATCOM | 
|---|
| 18 |  | 
|---|
| 19 | DLLS = ndpsmb | 
|---|
| 20 |  | 
|---|
| 21 | # required to get IPFC compiler to work correctly | 
|---|
| 22 | export IPFC=$(TOOLKIT)\IPFC | 
|---|
| 23 |  | 
|---|
| 24 | TOOL_OPENWATCOM_RCFLAGS += -i=$(TOOLKIT)/h | 
|---|
| 25 |  | 
|---|
| 26 | ndpsmb_SOURCES = \ | 
|---|
| 27 | rc/rc.rc \ | 
|---|
| 28 | ndpsmb.def \ | 
|---|
| 29 | ndpsmb.c \ | 
|---|
| 30 | debug.c \ | 
|---|
| 31 | util.c \ | 
|---|
| 32 | dircache.c \ | 
|---|
| 33 | smbwrp.c | 
|---|
| 34 |  | 
|---|
| 35 | ndpsmb_CFLAGS = -Zomf | 
|---|
| 36 | # YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0! | 
|---|
| 37 | ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4 | 
|---|
| 38 |  | 
|---|
| 39 | ndpsmb_CFLAGS.debug = -g -O0 -D_DEBUG | 
|---|
| 40 | ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zhigh-mem | 
|---|
| 41 | ndpsmb_LDFLAGS.release = -s | 
|---|
| 42 | ndpsmb_LDFLAGS.debug = -g | 
|---|
| 43 |  | 
|---|
| 44 | ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE) | 
|---|
| 45 | ndpsmb_INCS = ./h ./rc \ | 
|---|
| 46 | $(SAMBA)        \ | 
|---|
| 47 | $(SAMBA)/source3 \ | 
|---|
| 48 | $(SAMBA)/source3/include \ | 
|---|
| 49 | $(SAMBA)/lib/replace \ | 
|---|
| 50 | $(SAMBA)/popt \ | 
|---|
| 51 | $(SAMBA)/lib/talloc \ | 
|---|
| 52 | $(SAMBA)/librpc \ | 
|---|
| 53 | $(SAMBA)/lib/tdb/include \ | 
|---|
| 54 | $(SAMBA)/lib/tevent | 
|---|
| 55 |  | 
|---|
| 56 | ndpsmb_LIBS = libsmbclient libtalloc libtdb libwbclient libtevent z mmap cx0 | 
|---|
| 57 | ndpsmb_LIBPATH = $(SAMBA)/source3/bin $(Z_LIBDIR) | 
|---|
| 58 |  | 
|---|
| 59 | ndpsmb_CLEAN = rc/description.rc $(PATH_STAGE_LIB)/ndpsmb.dll | 
|---|
| 60 |  | 
|---|
| 61 | #build other files (e.g. help) | 
|---|
| 62 | OTHER_CLEAN += $(PATH_INST_BIN)/en/ndpsmb.hlp $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/readme.txt \ | 
|---|
| 63 | $(PATH_INST_BIN)/fr/ndpsmb.hlp $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/readme_fr.txt \ | 
|---|
| 64 | $(PATH_INST_BIN)/de/ndpsmb.hlp $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/readme_de.txt \ | 
|---|
| 65 | $(PATH_INST_BIN)/it/ndpsmb.hlp $(PATH_OBJ)/it/ndpsmb.ipf $(PATH_INST_BIN)/readme_it.txt | 
|---|
| 66 |  | 
|---|
| 67 | # install some more files | 
|---|
| 68 | INSTALLS = ndpsmb-docs | 
|---|
| 69 | ndpsmb-docs_INST = $(INST_BIN) | 
|---|
| 70 | ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd | 
|---|
| 71 |  | 
|---|
| 72 | OTHER_CLEAN += $(INST_BIN)/COPYING $(INST_BIN)/ndpsmb.ndp $(INST_BIN)/instpl.cmd $(INST_BIN)/uninstpl.cmd $(INST_BIN)/ndpsmb.dll $(PATH_OBJ)/ndpsmb.wis | 
|---|
| 73 |  | 
|---|
| 74 | # packaging stuffs | 
|---|
| 75 | ifeq ($(BUILD_TYPE),debug) | 
|---|
| 76 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug | 
|---|
| 77 | else | 
|---|
| 78 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD) | 
|---|
| 79 | endif | 
|---|
| 80 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip | 
|---|
| 81 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi | 
|---|
| 82 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip | 
|---|
| 83 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi | 
|---|
| 84 |  | 
|---|
| 85 | # now include standard code | 
|---|
| 86 | include $(PATH_KBUILD)/rules.kMk | 
|---|
| 87 |  | 
|---|
| 88 | # here follows standard gnu make inference rules | 
|---|
| 89 |  | 
|---|
| 90 | # add new dependancy on build level info | 
|---|
| 91 | rc/rc.rc : rc/description.rc nversion.h rc/rc.rc_ | 
|---|
| 92 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" rc/rc.rc_ \ | 
|---|
| 93 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \ | 
|---|
| 94 | | $(SED) "s;_BUILD_;$(BUILD);g" \ | 
|---|
| 95 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \ | 
|---|
| 96 | > rc/rc.rc | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 | # update bldlevel info | 
|---|
| 100 | rc/description.rc: config.kmk | 
|---|
| 101 | @echo Writing build level informations | 
|---|
| 102 | @cp rc/description.rc_ rc/description.rc | 
|---|
| 103 | $(QUIET)cmd /c 'BldLevelInf.cmd -V"$(VERSION)" -N"$(VENDOR)" -D"NDPSMB - SMBFS NetDrive External Plugin Build $(BUILD)" -Len rc\\description.rc' | 
|---|
| 104 |  | 
|---|
| 105 | # compile help file | 
|---|
| 106 | $(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt | 
|---|
| 107 | -@mkdir $(PATH_OBJ) | 
|---|
| 108 | -@mkdir $(PATH_OBJ)\en | 
|---|
| 109 | @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf | 
|---|
| 110 | -@mkdir $(PATH_INST_BIN) | 
|---|
| 111 | -@mkdir $(PATH_INST_BIN)\en | 
|---|
| 112 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 | 
|---|
| 113 |  | 
|---|
| 114 | $(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt | 
|---|
| 115 | -@mkdir $(PATH_OBJ) | 
|---|
| 116 | -@mkdir $(PATH_OBJ)\fr | 
|---|
| 117 | @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf | 
|---|
| 118 | -@mkdir $(PATH_INST_BIN) | 
|---|
| 119 | -@mkdir $(PATH_INST_BIN)\fr | 
|---|
| 120 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 | 
|---|
| 121 |  | 
|---|
| 122 | $(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt | 
|---|
| 123 | -@mkdir $(PATH_OBJ) | 
|---|
| 124 | -@mkdir $(PATH_OBJ)\de | 
|---|
| 125 | @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf | 
|---|
| 126 | -@mkdir $(PATH_INST_BIN) | 
|---|
| 127 | -@mkdir $(PATH_INST_BIN)\de | 
|---|
| 128 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 | 
|---|
| 129 |  | 
|---|
| 130 | $(PATH_INST_BIN)/it/ndpsmb.hlp: ./help/ndpsmb_it.ipf nversion.h Config.kmk ./help/changelog.txt | 
|---|
| 131 | -@mkdir $(PATH_OBJ) | 
|---|
| 132 | -@mkdir $(PATH_OBJ)\it | 
|---|
| 133 | @ppwizard.cmd ./help/ndpsmb_it.ipf /Pack:N /output:$(PATH_OBJ)/it/ndpsmb.ipf /other /WarningsRc:0 /Define:it /Define:ipf | 
|---|
| 134 | -@mkdir $(PATH_INST_BIN) | 
|---|
| 135 | -@mkdir $(PATH_INST_BIN)\it | 
|---|
| 136 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/it/ndpsmb.ipf $(PATH_INST_BIN)/it/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 | 
|---|
| 137 |  | 
|---|
| 138 |  | 
|---|
| 139 | # substitute macros in nversion.h | 
|---|
| 140 | nversion.h: Config.kmk nversion.tpl | 
|---|
| 141 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \ | 
|---|
| 142 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \ | 
|---|
| 143 | | $(SED) "s;_BUILD_;$(BUILD);g" \ | 
|---|
| 144 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \ | 
|---|
| 145 | > nversion.h | 
|---|
| 146 |  | 
|---|
| 147 | # substitute macros in docs | 
|---|
| 148 | $(PATH_INST_BIN)/readme.txt: Config.kmk ./help/readme.txt nversion.h ./help/changelog.txt | 
|---|
| 149 | @ppwizard.cmd ./help/readme.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme.txt /other /WarningsRc:0 /Define:en /Define:txt | 
|---|
| 150 |  | 
|---|
| 151 | $(PATH_INST_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt nversion.h ./help/changelog.txt | 
|---|
| 152 | @ppwizard.cmd ./help/readme_fr.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme_fr.txt /other /WarningsRc:0 /Define:fr /Define:txt | 
|---|
| 153 |  | 
|---|
| 154 | $(PATH_INST_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt nversion.h ./help/changelog.txt | 
|---|
| 155 | @ppwizard.cmd ./help/readme_de.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme_de.txt /other /WarningsRc:0 /Define:de /Define:txt | 
|---|
| 156 |  | 
|---|
| 157 | $(PATH_INST_BIN)/readme_it.txt: Config.kmk ./help/readme_it.txt nversion.h ./help/changelog.txt | 
|---|
| 158 | @ppwizard.cmd ./help/readme_it.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme_it.txt /other /WarningsRc:0 /Define:it /Define:txt | 
|---|
| 159 |  | 
|---|
| 160 |  | 
|---|
| 161 | # final: zip all files! | 
|---|
| 162 | $(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \ | 
|---|
| 163 | $(PATH_INST_BIN)/instpl.cmd \ | 
|---|
| 164 | $(PATH_INST_BIN)/ndpsmb.ndp \ | 
|---|
| 165 | $(PATH_INST_BIN)/uninstpl.cmd \ | 
|---|
| 166 | $(PATH_INST_BIN)/ndpsmb.dll \ | 
|---|
| 167 | $(PATH_INST_BIN)/COPYING \ | 
|---|
| 168 | $(PATH_INST_BIN)/en/ndpsmb.hlp \ | 
|---|
| 169 | $(PATH_INST_BIN)/fr/ndpsmb.hlp \ | 
|---|
| 170 | $(PATH_INST_BIN)/de/ndpsmb.hlp \ | 
|---|
| 171 | $(PATH_INST_BIN)/it/ndpsmb.hlp \ | 
|---|
| 172 | $(PATH_INST_BIN)/readme.txt \ | 
|---|
| 173 | $(PATH_INST_BIN)/readme_fr.txt \ | 
|---|
| 174 | $(PATH_INST_BIN)/readme_de.txt \ | 
|---|
| 175 | $(PATH_INST_BIN)/readme_it.txt | 
|---|
| 176 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist | 
|---|
| 177 | $(QUIET)$(RM) -f $@ | 
|---|
| 178 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- zip -9Sr $@ . | 
|---|
| 179 |  | 
|---|
| 180 |  | 
|---|
| 181 | # final2: wpi all files! | 
|---|
| 182 | $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi: \ | 
|---|
| 183 | ./resources/ndpsmb.tpl \ | 
|---|
| 184 | $(PATH_INST_BIN)/instpl.cmd \ | 
|---|
| 185 | $(PATH_INST_BIN)/ndpsmb.ndp \ | 
|---|
| 186 | $(PATH_INST_BIN)/uninstpl.cmd \ | 
|---|
| 187 | $(PATH_INST_BIN)/ndpsmb.dll \ | 
|---|
| 188 | $(PATH_INST_BIN)/COPYING \ | 
|---|
| 189 | $(PATH_INST_BIN)/en/ndpsmb.hlp \ | 
|---|
| 190 | $(PATH_INST_BIN)/fr/ndpsmb.hlp \ | 
|---|
| 191 | $(PATH_INST_BIN)/de/ndpsmb.hlp \ | 
|---|
| 192 | $(PATH_INST_BIN)/it/ndpsmb.hlp \ | 
|---|
| 193 | $(PATH_INST_BIN)/readme.txt \ | 
|---|
| 194 | $(PATH_INST_BIN)/readme_fr.txt \ | 
|---|
| 195 | $(PATH_INST_BIN)/readme_de.txt \ | 
|---|
| 196 | $(PATH_INST_BIN)/readme_it.txt | 
|---|
| 197 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist | 
|---|
| 198 | $(QUIET)$(RM) -f $@ | 
|---|
| 199 | @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0 | 
|---|
| 200 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 2 -r ".\en\*.hlp" | 
|---|
| 201 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 3 -r ".\fr\*.hlp" | 
|---|
| 202 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 4 -r ".\de\*.hlp" | 
|---|
| 203 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -s $(subst /,\\,$(PATH_OBJ))\\ndpsmb.wis -a 1 "*" | 
|---|