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