1 | #
|
---|
2 | # please define (as env variables or kmk command line) the following variables before starting:
|
---|
3 | # BUILD_PLATFORM = os2
|
---|
4 | # BUILD_TYPE = release|debug
|
---|
5 | #
|
---|
6 | # Copy Config.km_ to Config.kmk and edit it to match your installation.
|
---|
7 | #
|
---|
8 |
|
---|
9 | DEPTH = ..
|
---|
10 |
|
---|
11 | TOOL = GCC3OMF
|
---|
12 |
|
---|
13 | DLLS = ndpsmb
|
---|
14 |
|
---|
15 | ndpsmb_SOURCES = \
|
---|
16 | rc/rc.rc \
|
---|
17 | ndpsmb.def \
|
---|
18 | ndpsmb.c \
|
---|
19 | debug.c \
|
---|
20 | printf.c \
|
---|
21 | util.c \
|
---|
22 | smbwrp.c
|
---|
23 |
|
---|
24 | ndpsmb_CFLAGS = -Zomf
|
---|
25 | ndpsmb_CFLAGS.release = -s -O3 -march=pentium -mcpu=pentium4
|
---|
26 | ndpsmb_CFLAGS.debug = -g -O0 -DDEBUG_PRINTF
|
---|
27 | ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zbin-files
|
---|
28 | ndpsmb_LDFLAGS.release = -s
|
---|
29 | ndpsmb_LDFLAGS.debug = -g
|
---|
30 |
|
---|
31 | ndpsmb_DEFS =
|
---|
32 | ndpsmb_INCS = ./h ./rc \
|
---|
33 | $(SAMBA)/source \
|
---|
34 | $(SAMBA)/source/include \
|
---|
35 | $(SAMBA)/source/lib/replace \
|
---|
36 | $(SAMBA)/source/popt \
|
---|
37 | $(SAMBA)/source/lib/talloc \
|
---|
38 | $(SAMBA)/source/librpc \
|
---|
39 | $(SAMBA)/source/tdb/include
|
---|
40 |
|
---|
41 | ndpsmb_LIBS = libsmbclient.a socket.a
|
---|
42 | ndpsmb_LIBPATH = $(SAMBA)/source/bin
|
---|
43 |
|
---|
44 | ndpsmb_CLEAN = rc/description.rc $(PATH_BIN)/ndpsmb.dll
|
---|
45 |
|
---|
46 |
|
---|
47 | #build other files (e.g. help)
|
---|
48 | OTHERS = $(PATH_BIN)/ndpsmb.hlp $(PATH_BIN)/readme.txt
|
---|
49 | OTHER_CLEAN = $(PATH_BIN)/ndpsmb.hlp $(PATH_BIN)/readme.txt
|
---|
50 |
|
---|
51 |
|
---|
52 | # install some more files
|
---|
53 | INSTALLS = ndpsmb-docs
|
---|
54 | ndpsmb-docs_INST = bin/
|
---|
55 | ndpsmb-docs_SOURCES = $(SAMBA)/COPYING=>COPYING ndpsmb.ndp instpl.cmd
|
---|
56 | OTHER_CLEAN += $(PATH_BIN)/COPYING $(PATH_BIN)/ndpsmb.ndp $(PATH_BIN)/instpl.cmd
|
---|
57 |
|
---|
58 |
|
---|
59 | # packaging stuffs
|
---|
60 | ifeq ($(BUILD_TYPE),debug)
|
---|
61 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug.zip
|
---|
62 | else
|
---|
63 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD).zip
|
---|
64 | endif
|
---|
65 | PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
66 | OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
67 |
|
---|
68 | # now include standard code
|
---|
69 | include $(PATH_KBUILD)/rules.kMk
|
---|
70 |
|
---|
71 | # here follows standard gnu make inference rules
|
---|
72 |
|
---|
73 | # add new dependancy on build level info
|
---|
74 | rc/rc.rc : rc/description.rc
|
---|
75 |
|
---|
76 | # update bldlevel info
|
---|
77 | rc/description.rc: config.kmk
|
---|
78 | @echo Writing build level informations
|
---|
79 | @cp rc/description.rc_ rc/description.rc
|
---|
80 | @BldLevelInf0.cmd $(VERSION) $(BUILD)
|
---|
81 |
|
---|
82 | # compile help file
|
---|
83 | $(PATH_BIN)/ndpsmb.hlp: ./rc/rc.ipf ./rc/rc.h ./H/hmacros.h config.kmk
|
---|
84 | -gcc -E -I./h -I./rc -x c ./rc/rc.ipf > rc.i
|
---|
85 | -@mkdir $(PATH_BIN)
|
---|
86 | $(TOOLKIT)\bin\ipfc.exe rc.i $(PATH_BIN)/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
87 | rm rc.i
|
---|
88 |
|
---|
89 | # substitute macros in docs
|
---|
90 | $(PATH_BIN)/readme.txt: Config.kmk readme.txt
|
---|
91 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" readme.txt \
|
---|
92 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
93 | > $(PATH_BIN)/readme.txt
|
---|
94 |
|
---|
95 | # final: zip all files!
|
---|
96 | $(PATH_ROOT)/dist/$(PACKAGE_NAME): \
|
---|
97 | $(PATH_BIN)/ndpsmb.dll \
|
---|
98 | $(PATH_BIN)/ndpsmb.hlp \
|
---|
99 | $(PATH_BIN)/readme.txt
|
---|
100 | $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist
|
---|
101 | $(QUIET)$(RM) -f $@
|
---|
102 | $(QUIET)zip -9 -j $@ $(PATH_BIN)/*
|
---|
103 |
|
---|