| [146] | 1 | #
|
|---|
| [151] | 2 | # Netdrive Samba client plugin
|
|---|
| 3 | # kBuild makefile
|
|---|
| 4 | # Copyright (C) netlabs.org 2003-2008
|
|---|
| 5 | # See COPYING for license informations
|
|---|
| 6 | #
|
|---|
| [146] | 7 | # please define (as env variables or kmk command line) the following variables before starting:
|
|---|
| 8 | # BUILD_PLATFORM = os2
|
|---|
| [147] | 9 | # BUILD_TYPE = release|debug
|
|---|
| [146] | 10 | #
|
|---|
| 11 | # Copy Config.km_ to Config.kmk and edit it to match your installation.
|
|---|
| 12 | #
|
|---|
| 13 |
|
|---|
| 14 | DEPTH = ..
|
|---|
| 15 |
|
|---|
| [195] | 16 | ndpsmb_TOOL = GCC3OMF
|
|---|
| [893] | 17 | ndpsmb_RCTOOL = OPENWATCOM
|
|---|
| [146] | 18 |
|
|---|
| 19 | DLLS = ndpsmb
|
|---|
| 20 |
|
|---|
| [401] | 21 | # required to get IPFC compiler to work correctly
|
|---|
| 22 | export IPFC=$(TOOLKIT)\IPFC
|
|---|
| 23 |
|
|---|
| [893] | 24 | TOOL_OPENWATCOM_RCFLAGS += -i=$(TOOLKIT)/h
|
|---|
| [181] | 25 |
|
|---|
| [146] | 26 | ndpsmb_SOURCES = \
|
|---|
| 27 | rc/rc.rc \
|
|---|
| 28 | ndpsmb.def \
|
|---|
| 29 | ndpsmb.c \
|
|---|
| 30 | debug.c \
|
|---|
| [147] | 31 | util.c \
|
|---|
| [499] | 32 | dircache.c \
|
|---|
| [146] | 33 | smbwrp.c
|
|---|
| 34 |
|
|---|
| [147] | 35 | ndpsmb_CFLAGS = -Zomf
|
|---|
| [401] | 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
|
|---|
| [441] | 38 |
|
|---|
| [971] | 39 | ndpsmb_CFLAGS.debug = -g -O0 -D_DEBUG
|
|---|
| [674] | 40 | ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zhigh-mem
|
|---|
| [147] | 41 | ndpsmb_LDFLAGS.release = -s
|
|---|
| 42 | ndpsmb_LDFLAGS.debug = -g
|
|---|
| [146] | 43 |
|
|---|
| [584] | 44 | ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE)
|
|---|
| [146] | 45 | ndpsmb_INCS = ./h ./rc \
|
|---|
| [627] | 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 \
|
|---|
| [645] | 54 | $(SAMBA)/lib/tevent
|
|---|
| [146] | 55 |
|
|---|
| [956] | 56 | ndpsmb_LIBS = libsmbclient libtalloc libtdb libwbclient libtevent z mmap cx0
|
|---|
| [627] | 57 | ndpsmb_LIBPATH = $(SAMBA)/source3/bin $(Z_LIBDIR)
|
|---|
| [146] | 58 |
|
|---|
| [651] | 59 | ndpsmb_CLEAN = rc/description.rc $(PATH_STAGE_LIB)/ndpsmb.dll
|
|---|
| [146] | 60 |
|
|---|
| 61 | #build other files (e.g. help)
|
|---|
| [687] | 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 \
|
|---|
| [996] | 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
|
|---|
| [146] | 66 |
|
|---|
| [148] | 67 | # install some more files
|
|---|
| 68 | INSTALLS = ndpsmb-docs
|
|---|
| [803] | 69 | ndpsmb-docs_INST = $(INST_BIN)
|
|---|
| [530] | 70 | ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd
|
|---|
| [148] | 71 |
|
|---|
| [687] | 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 |
|
|---|
| [148] | 74 | # packaging stuffs
|
|---|
| 75 | ifeq ($(BUILD_TYPE),debug)
|
|---|
| [401] | 76 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug
|
|---|
| [148] | 77 | else
|
|---|
| [401] | 78 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)
|
|---|
| [148] | 79 | endif
|
|---|
| [687] | 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
|
|---|
| [148] | 84 |
|
|---|
| [147] | 85 | # now include standard code
|
|---|
| [146] | 86 | include $(PATH_KBUILD)/rules.kMk
|
|---|
| 87 |
|
|---|
| [148] | 88 | # here follows standard gnu make inference rules
|
|---|
| 89 |
|
|---|
| [146] | 90 | # add new dependancy on build level info
|
|---|
| [521] | 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" \
|
|---|
| [756] | 95 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \
|
|---|
| [521] | 96 | > rc/rc.rc
|
|---|
| [146] | 97 |
|
|---|
| [521] | 98 |
|
|---|
| [148] | 99 | # update bldlevel info
|
|---|
| [146] | 100 | rc/description.rc: config.kmk
|
|---|
| 101 | @echo Writing build level informations
|
|---|
| 102 | @cp rc/description.rc_ rc/description.rc
|
|---|
| [731] | 103 | $(QUIET)cmd /c 'BldLevelInf.cmd -V"$(VERSION)" -N"$(VENDOR)" -D"NDPSMB - SMBFS NetDrive External Plugin Build $(BUILD)" -Len rc\\description.rc'
|
|---|
| [146] | 104 |
|
|---|
| [148] | 105 | # compile help file
|
|---|
| [687] | 106 | $(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| [401] | 107 | -@mkdir $(PATH_OBJ)
|
|---|
| 108 | -@mkdir $(PATH_OBJ)\en
|
|---|
| [541] | 109 | @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf
|
|---|
| [687] | 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
|
|---|
| [146] | 113 |
|
|---|
| [687] | 114 | $(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| [401] | 115 | -@mkdir $(PATH_OBJ)
|
|---|
| 116 | -@mkdir $(PATH_OBJ)\fr
|
|---|
| [541] | 117 | @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf
|
|---|
| [687] | 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
|
|---|
| [401] | 121 |
|
|---|
| [687] | 122 | $(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| [441] | 123 | -@mkdir $(PATH_OBJ)
|
|---|
| 124 | -@mkdir $(PATH_OBJ)\de
|
|---|
| [541] | 125 | @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf
|
|---|
| [687] | 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
|
|---|
| [401] | 129 |
|
|---|
| [996] | 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
|
|---|
| [441] | 137 |
|
|---|
| [996] | 138 |
|
|---|
| [448] | 139 | # substitute macros in nversion.h
|
|---|
| 140 | nversion.h: Config.kmk nversion.tpl
|
|---|
| 141 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \
|
|---|
| [401] | 142 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
|
|---|
| 143 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
|---|
| [756] | 144 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \
|
|---|
| [448] | 145 | > nversion.h
|
|---|
| [401] | 146 |
|
|---|
| [148] | 147 | # substitute macros in docs
|
|---|
| [687] | 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
|
|---|
| [148] | 150 |
|
|---|
| [687] | 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
|
|---|
| [401] | 153 |
|
|---|
| [687] | 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
|
|---|
| [441] | 156 |
|
|---|
| [996] | 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
|
|---|
| [687] | 159 |
|
|---|
| [996] | 160 |
|
|---|
| [148] | 161 | # final: zip all files!
|
|---|
| [687] | 162 | $(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \
|
|---|
| 163 | $(PATH_INST_BIN)/instpl.cmd \
|
|---|
| [803] | 164 | $(PATH_INST_BIN)/ndpsmb.ndp \
|
|---|
| [687] | 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 \
|
|---|
| [996] | 171 | $(PATH_INST_BIN)/it/ndpsmb.hlp \
|
|---|
| [687] | 172 | $(PATH_INST_BIN)/readme.txt \
|
|---|
| 173 | $(PATH_INST_BIN)/readme_fr.txt \
|
|---|
| [996] | 174 | $(PATH_INST_BIN)/readme_de.txt \
|
|---|
| 175 | $(PATH_INST_BIN)/readme_it.txt
|
|---|
| [687] | 176 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
|
|---|
| [148] | 177 | $(QUIET)$(RM) -f $@
|
|---|
| [883] | 178 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- zip -9Sr $@ .
|
|---|
| [148] | 179 |
|
|---|
| [530] | 180 |
|
|---|
| [401] | 181 | # final2: wpi all files!
|
|---|
| [687] | 182 | $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi: \
|
|---|
| [449] | 183 | ./resources/ndpsmb.tpl \
|
|---|
| [687] | 184 | $(PATH_INST_BIN)/instpl.cmd \
|
|---|
| [803] | 185 | $(PATH_INST_BIN)/ndpsmb.ndp \
|
|---|
| [687] | 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 \
|
|---|
| [996] | 192 | $(PATH_INST_BIN)/it/ndpsmb.hlp \
|
|---|
| [687] | 193 | $(PATH_INST_BIN)/readme.txt \
|
|---|
| 194 | $(PATH_INST_BIN)/readme_fr.txt \
|
|---|
| [996] | 195 | $(PATH_INST_BIN)/readme_de.txt \
|
|---|
| 196 | $(PATH_INST_BIN)/readme_it.txt
|
|---|
| [687] | 197 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
|
|---|
| [401] | 198 | $(QUIET)$(RM) -f $@
|
|---|
| [449] | 199 | @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0
|
|---|
| [687] | 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 "*"
|
|---|