| 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 |
|
|---|
| 18 | DLLS = ndpsmb
|
|---|
| 19 |
|
|---|
| 20 | # required to get IPFC compiler to work correctly
|
|---|
| 21 | export IPFC=$(TOOLKIT)\IPFC
|
|---|
| 22 |
|
|---|
| 23 | TOOL_GCC3OMF_RCFLAGS += -i=$(TOOLKIT)/h
|
|---|
| 24 |
|
|---|
| 25 | ndpsmb_SOURCES = \
|
|---|
| 26 | rc/rc.rc \
|
|---|
| 27 | ndpsmb.def \
|
|---|
| 28 | ndpsmb.c \
|
|---|
| 29 | debug.c \
|
|---|
| 30 | util.c \
|
|---|
| 31 | dircache.c \
|
|---|
| 32 | smbwrp.c
|
|---|
| 33 |
|
|---|
| 34 | ndpsmb_CFLAGS = -Zomf
|
|---|
| 35 | # YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0!
|
|---|
| 36 | ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4
|
|---|
| 37 |
|
|---|
| 38 | ndpsmb_CFLAGS.debug = -g -O0
|
|---|
| 39 | ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zhigh-mem
|
|---|
| 40 | ndpsmb_LDFLAGS.release = -s
|
|---|
| 41 | ndpsmb_LDFLAGS.debug = -g
|
|---|
| 42 |
|
|---|
| 43 | ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE)
|
|---|
| 44 | ndpsmb_INCS = ./h ./rc \
|
|---|
| 45 | $(SAMBA) \
|
|---|
| 46 | $(SAMBA)/source3 \
|
|---|
| 47 | $(SAMBA)/source3/include \
|
|---|
| 48 | $(SAMBA)/lib/replace \
|
|---|
| 49 | $(SAMBA)/popt \
|
|---|
| 50 | $(SAMBA)/lib/talloc \
|
|---|
| 51 | $(SAMBA)/librpc \
|
|---|
| 52 | $(SAMBA)/lib/tdb/include \
|
|---|
| 53 | $(SAMBA)/lib/tevent
|
|---|
| 54 |
|
|---|
| 55 | ndpsmb_LIBS = libsmbclient.a socket.a libtalloc.a libtdb.a libwbclient.a z
|
|---|
| 56 | ndpsmb_LIBS += $(GCC_LIB)/binmode.obj
|
|---|
| 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 |
|
|---|
| 66 | # install some more files
|
|---|
| 67 | INSTALLS = ndpsmb-docs
|
|---|
| 68 | ndpsmb-docs_INST = $(INST_BIN)
|
|---|
| 69 | ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd
|
|---|
| 70 |
|
|---|
| 71 | 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
|
|---|
| 72 |
|
|---|
| 73 | # packaging stuffs
|
|---|
| 74 | ifeq ($(BUILD_TYPE),debug)
|
|---|
| 75 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug
|
|---|
| 76 | else
|
|---|
| 77 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)
|
|---|
| 78 | endif
|
|---|
| 79 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
|
|---|
| 80 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
|
|---|
| 81 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
|
|---|
| 82 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
|
|---|
| 83 |
|
|---|
| 84 | # now include standard code
|
|---|
| 85 | include $(PATH_KBUILD)/rules.kMk
|
|---|
| 86 |
|
|---|
| 87 | # here follows standard gnu make inference rules
|
|---|
| 88 |
|
|---|
| 89 | # add new dependancy on build level info
|
|---|
| 90 | rc/rc.rc : rc/description.rc nversion.h rc/rc.rc_
|
|---|
| 91 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" rc/rc.rc_ \
|
|---|
| 92 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
|
|---|
| 93 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
|---|
| 94 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \
|
|---|
| 95 | > rc/rc.rc
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | # update bldlevel info
|
|---|
| 99 | rc/description.rc: config.kmk
|
|---|
| 100 | @echo Writing build level informations
|
|---|
| 101 | @cp rc/description.rc_ rc/description.rc
|
|---|
| 102 | $(QUIET)cmd /c 'BldLevelInf.cmd -V"$(VERSION)" -N"$(VENDOR)" -D"NDPSMB - SMBFS NetDrive External Plugin Build $(BUILD)" -Len rc\\description.rc'
|
|---|
| 103 |
|
|---|
| 104 | # compile help file
|
|---|
| 105 | $(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| 106 | -@mkdir $(PATH_OBJ)
|
|---|
| 107 | -@mkdir $(PATH_OBJ)\en
|
|---|
| 108 | @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf
|
|---|
| 109 | -@mkdir $(PATH_INST_BIN)
|
|---|
| 110 | -@mkdir $(PATH_INST_BIN)\en
|
|---|
| 111 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
|---|
| 112 |
|
|---|
| 113 | $(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| 114 | -@mkdir $(PATH_OBJ)
|
|---|
| 115 | -@mkdir $(PATH_OBJ)\fr
|
|---|
| 116 | @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf
|
|---|
| 117 | -@mkdir $(PATH_INST_BIN)
|
|---|
| 118 | -@mkdir $(PATH_INST_BIN)\fr
|
|---|
| 119 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
|---|
| 120 |
|
|---|
| 121 | $(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt
|
|---|
| 122 | -@mkdir $(PATH_OBJ)
|
|---|
| 123 | -@mkdir $(PATH_OBJ)\de
|
|---|
| 124 | @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf
|
|---|
| 125 | -@mkdir $(PATH_INST_BIN)
|
|---|
| 126 | -@mkdir $(PATH_INST_BIN)\de
|
|---|
| 127 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 | # substitute macros in nversion.h
|
|---|
| 131 | nversion.h: Config.kmk nversion.tpl
|
|---|
| 132 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \
|
|---|
| 133 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
|
|---|
| 134 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
|---|
| 135 | | $(SED) "s;_VENDOR_;$(VENDOR);g" \
|
|---|
| 136 | > nversion.h
|
|---|
| 137 |
|
|---|
| 138 | # substitute macros in docs
|
|---|
| 139 | $(PATH_INST_BIN)/readme.txt: Config.kmk ./help/readme.txt nversion.h ./help/changelog.txt
|
|---|
| 140 | @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
|
|---|
| 141 |
|
|---|
| 142 | $(PATH_INST_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt nversion.h ./help/changelog.txt
|
|---|
| 143 | @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
|
|---|
| 144 |
|
|---|
| 145 | $(PATH_INST_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt nversion.h ./help/changelog.txt
|
|---|
| 146 | @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
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 | # final: zip all files!
|
|---|
| 150 | $(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \
|
|---|
| 151 | $(PATH_INST_BIN)/instpl.cmd \
|
|---|
| 152 | $(PATH_INST_BIN)/ndpsmb.ndp \
|
|---|
| 153 | $(PATH_INST_BIN)/uninstpl.cmd \
|
|---|
| 154 | $(PATH_INST_BIN)/ndpsmb.dll \
|
|---|
| 155 | $(PATH_INST_BIN)/COPYING \
|
|---|
| 156 | $(PATH_INST_BIN)/en/ndpsmb.hlp \
|
|---|
| 157 | $(PATH_INST_BIN)/fr/ndpsmb.hlp \
|
|---|
| 158 | $(PATH_INST_BIN)/de/ndpsmb.hlp \
|
|---|
| 159 | $(PATH_INST_BIN)/readme.txt \
|
|---|
| 160 | $(PATH_INST_BIN)/readme_fr.txt \
|
|---|
| 161 | $(PATH_INST_BIN)/readme_de.txt
|
|---|
| 162 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
|
|---|
| 163 | $(QUIET)$(RM) -f $@
|
|---|
| 164 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- zip -Sr9 $@ \*
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 | # final2: wpi all files!
|
|---|
| 168 | $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi: \
|
|---|
| 169 | ./resources/ndpsmb.tpl \
|
|---|
| 170 | $(PATH_INST_BIN)/instpl.cmd \
|
|---|
| 171 | $(PATH_INST_BIN)/ndpsmb.ndp \
|
|---|
| 172 | $(PATH_INST_BIN)/uninstpl.cmd \
|
|---|
| 173 | $(PATH_INST_BIN)/ndpsmb.dll \
|
|---|
| 174 | $(PATH_INST_BIN)/COPYING \
|
|---|
| 175 | $(PATH_INST_BIN)/en/ndpsmb.hlp \
|
|---|
| 176 | $(PATH_INST_BIN)/fr/ndpsmb.hlp \
|
|---|
| 177 | $(PATH_INST_BIN)/de/ndpsmb.hlp \
|
|---|
| 178 | $(PATH_INST_BIN)/readme.txt \
|
|---|
| 179 | $(PATH_INST_BIN)/readme_fr.txt \
|
|---|
| 180 | $(PATH_INST_BIN)/readme_de.txt
|
|---|
| 181 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
|
|---|
| 182 | $(QUIET)$(RM) -f $@
|
|---|
| 183 | @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0
|
|---|
| 184 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 2 -r ".\en\*.hlp"
|
|---|
| 185 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 3 -r ".\fr\*.hlp"
|
|---|
| 186 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 4 -r ".\de\*.hlp"
|
|---|
| 187 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -s $(subst /,\\,$(PATH_OBJ))\\ndpsmb.wis -a 1 "*"
|
|---|