# # Netdrive Samba client plugin # kBuild makefile # Copyright (C) netlabs.org 2003-2008 # See COPYING for license informations # # please define (as env variables or kmk command line) the following variables before starting: # BUILD_PLATFORM = os2 # BUILD_TYPE = release|debug # # Copy Config.km_ to Config.kmk and edit it to match your installation. # DEPTH = .. ndpsmb_TOOL = GCC3OMF ndpsmb_RCTOOL = OPENWATCOM DLLS = ndpsmb # required to get IPFC compiler to work correctly export IPFC=$(TOOLKIT)\IPFC ndpsmb_RCTOOL =OPENWATCOM TOOL_OPENWATCOM_RCFLAGS += -i=$(TOOLKIT)/h ndpsmb_SOURCES = \ rc/rc.rc \ ndpsmb.def \ ndpsmb.c \ debug.c \ printf.c \ util.c \ smbwrp.c ndpsmb_CFLAGS = -Zomf # YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0! # ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4 # SCS when building with gcc 3.3.5 use the below cflags # ndpsmb_CFLAGS.release = -s -O3 -march=pentium -mcpu=pentium3 ndpsmb_CFLAGS.release = -s -O1 -march=pentium -mtune=pentium3 ndpsmb_CFLAGS.debug = -g -O0 -DDEBUG_PRINTF ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zbin-files ndpsmb_LDFLAGS.release = -s ndpsmb_LDFLAGS.debug = -g ndpsmb_DEFS = ndpsmb_INCS = ./h ./rc \ $(SAMBA)/source \ $(SAMBA)/source/include \ $(SAMBA)/source/lib/replace \ $(SAMBA)/source/popt \ $(SAMBA)/source/lib/talloc \ $(SAMBA)/source/librpc \ $(SAMBA)/source/tdb/include \ $(GCC_INC) ndpsmb_LIBS = libsmbclient.a socket.a ndpsmb_LIBPATH = $(SAMBA)/source/bin ndpsmb_CLEAN = rc/description.rc $(PATH_BIN)/ndpsmb.dll #build other files (e.g. help) OTHERS = $(PATH_BIN)/en/ndpsmb.hlp $(PATH_BIN)/readme.txt \ $(PATH_BIN)/fr/ndpsmb.hlp $(PATH_BIN)/readme_fr.txt \ $(PATH_BIN)/de/ndpsmb.hlp $(PATH_BIN)/readme_de.txt OTHER_CLEAN = $(PATH_BIN)/en/ndpsmb.hlp $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_BIN)/readme.txt \ $(PATH_BIN)/fr/ndpsmb.hlp $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_BIN)/readme_fr.txt \ $(PATH_BIN)/de/ndpsmb.hlp $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_BIN)/readme_de.txt # install some more files INSTALLS = ndpsmb-docs ndpsmb-docs_INST = bin/ ndpsmb-docs_SOURCES = $(SAMBA)/COPYING=>COPYING resources/ndpsmb.ndp resources/instpl.cmd OTHER_CLEAN += $(PATH_BIN)/COPYING $(PATH_BIN)/ndpsmb.ndp $(PATH_BIN)/instpl.cmd # packaging stuffs ifeq ($(BUILD_TYPE),debug) PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug else PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD) endif PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME).zip PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME).wpi OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME).zip OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME).wpi # now include standard code include $(PATH_KBUILD)/rules.kMk # here follows standard gnu make inference rules # add new dependancy on build level info rc/rc.rc : rc/description.rc # update bldlevel info rc/description.rc: config.kmk @echo Writing build level informations @cp rc/description.rc_ rc/description.rc @BldLevelInf0.cmd $(VERSION) $(BUILD) # compile help file $(PATH_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf version.h Config.kmk -@mkdir $(PATH_OBJ) -@mkdir $(PATH_OBJ)\en @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 -@mkdir $(PATH_BIN) -@mkdir $(PATH_BIN)\en $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 $(PATH_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf version.h Config.kmk -@mkdir $(PATH_OBJ) -@mkdir $(PATH_OBJ)\fr @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 -@mkdir $(PATH_BIN) -@mkdir $(PATH_BIN)\fr $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 $(PATH_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf version.h Config.kmk -@mkdir $(PATH_OBJ) -@mkdir $(PATH_OBJ)\de @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 -@mkdir $(PATH_BIN) -@mkdir $(PATH_BIN)\de $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 # substitute macros in version.h version.h: Config.kmk version.h_ $(SED) "s;_VERSION_;$(VERSION);g" version.h_ \ | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \ | $(SED) "s;_BUILD_;$(BUILD);g" \ > version.h # substitute macros in docs $(PATH_BIN)/readme.txt: Config.kmk ./help/readme.txt $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./help/readme.txt \ | $(SED) "s;_BUILD_;$(BUILD);g" \ > $(PATH_BIN)/readme.txt $(PATH_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./help/readme_fr.txt \ | $(SED) "s;_BUILD_;$(BUILD);g" \ > $(PATH_BIN)/readme_fr.txt $(PATH_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./help/readme_de.txt \ | $(SED) "s;_BUILD_;$(BUILD);g" \ > $(PATH_BIN)/readme_de.txt # final: zip all files! $(PATH_ROOT)/dist/$(PACKAGE_NAME): \ $(PATH_BIN)/ndpsmb.dll \ $(PATH_BIN)/en/ndpsmb.hlp \ $(PATH_BIN)/fr/ndpsmb.hlp \ $(PATH_BIN)/de/ndpsmb.hlp \ $(PATH_BIN)/readme.txt \ $(PATH_BIN)/readme_fr.txt \ $(PATH_BIN)/readme_de.txt $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist $(QUIET)$(RM) -f $@ $(QUIET)zip -9 -j $@ $(PATH_BIN)/* # final2: wpi all files! $(PATH_ROOT)/dist/$(PACKAGE_NAME).wpi: \ ./resources/ndpsmb.wis_ \ $(PATH_BIN)/ndpsmb.dll \ $(PATH_BIN)/en/ndpsmb.hlp \ $(PATH_BIN)/fr/ndpsmb.hlp \ $(PATH_BIN)/de/ndpsmb.hlp \ $(PATH_BIN)/readme.txt \ $(PATH_BIN)/readme_fr.txt \ $(PATH_BIN)/readme_de.txt $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist $(QUIET)$(RM) -f $@ @ppwizard.cmd resources/ndpsmb.wis_ /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0 $(QUIET)$(REDIRECT) -C $(PATH_BIN)/en -- runwic.cmd $(subst /,\\,$@) -a 2 -r "*" $(QUIET)$(REDIRECT) -C $(PATH_BIN)/fr -- runwic.cmd $(subst /,\\,$@) -a 2 -r "*" $(QUIET)$(REDIRECT) -C $(PATH_BIN)/de -- runwic.cmd $(subst /,\\,$@) -a 2 -r "*" $(QUIET)$(REDIRECT) -C $(PATH_BIN) -- runwic.cmd $(subst /,\\,$@) -s $(subst /,\\,$(PATH_OBJ))\\ndpsmb.wis -a 1 "*"