1 | #
|
---|
2 | # Universal port driver
|
---|
3 | # kBuild makefile
|
---|
4 | # Copyright (C) netlabs.org 2003-2009
|
---|
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 | TOOL = GCC3OMF
|
---|
17 |
|
---|
18 | DLLS = uni
|
---|
19 |
|
---|
20 | # required to get IPFC compiler to work correctly
|
---|
21 | export IPFC=$(TOOLKIT)\IPFC
|
---|
22 |
|
---|
23 | uni_RCTOOL =OPENWATCOM
|
---|
24 | TOOL_OPENWATCOM_RCFLAGS += -i=$(TOOLKIT)/h
|
---|
25 |
|
---|
26 | uni_main_SOURCES = \
|
---|
27 | uni.def \
|
---|
28 | uni.c
|
---|
29 |
|
---|
30 | # english source
|
---|
31 | uni_INST = bin/en/
|
---|
32 | uni_SOURCES = $(uni_main_SOURCES) en/uni.rc
|
---|
33 |
|
---|
34 | # german source
|
---|
35 | DLLS += uni_de
|
---|
36 | uni_de_EXTENDS = uni
|
---|
37 | uni_de_NAME = uni
|
---|
38 | uni_de_INST = bin/de/
|
---|
39 | uni_de_SOURCES = $(uni_main_SOURCES) de/uni.rc
|
---|
40 | uni_de_CLEAN = $(PATH_BIN)/de/uni.pdr
|
---|
41 |
|
---|
42 | uni_CFLAGS = -Zdll -Zbin-files -Zomf
|
---|
43 | uni_CFLAGS.release = -s -O1 -march=pentium -mtune=pentium4
|
---|
44 | uni_CFLAGS.debug = -g -O0 -DDEBUG
|
---|
45 | # gcc -Zdll -Zbin-files -Zomf -o smb.pdr smb.o smb.def smb.res
|
---|
46 | # uni_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zbin-files
|
---|
47 | uni_LDFLAGS = -Zdll -Zbin-files -Zomf
|
---|
48 | uni_LDFLAGS.release = -s
|
---|
49 | uni_LDFLAGS.debug = -g
|
---|
50 |
|
---|
51 |
|
---|
52 | uni_DEFS =
|
---|
53 | uni_INCS = ./h
|
---|
54 |
|
---|
55 | uni_DLLSUFF = .pdr
|
---|
56 |
|
---|
57 | uni_CLEAN = description.rc $(PATH_BIN)/uni.pdr
|
---|
58 |
|
---|
59 | #build other files en (e.g. help)
|
---|
60 | OTHERS = /en/uni.ipf $(PATH_BIN)/en/uni.hlp $(PATH_BIN)/en/readme.txt
|
---|
61 | OTHER_CLEAN = $(PATH_BIN)/en/uni.hlp $(PATH_BIN)/en/readme.txt
|
---|
62 |
|
---|
63 | #build other files de (e.g. help)
|
---|
64 | OTHERS += /de/uni.ipf $(PATH_BIN)/de/uni.hlp $(PATH_BIN)/de/readme.txt
|
---|
65 | OTHER_CLEAN += $(PATH_BIN)/de/uni.hlp $(PATH_BIN)/de/readme.txt
|
---|
66 |
|
---|
67 |
|
---|
68 | #install some more files
|
---|
69 | INSTALLS = docs
|
---|
70 | docs_INST = bin/
|
---|
71 | docs_SOURCES = uni.ico
|
---|
72 | OTHER_CLEAN += $(PATH_BIN)/uni.ico
|
---|
73 |
|
---|
74 | # packaging stuffs
|
---|
75 | ifeq ($(BUILD_TYPE),debug)
|
---|
76 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD)-debug.zip
|
---|
77 | else
|
---|
78 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD).zip
|
---|
79 | endif
|
---|
80 | PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
81 | OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
82 |
|
---|
83 | # now include standard code
|
---|
84 | include $(PATH_KBUILD)/rules.kMk
|
---|
85 |
|
---|
86 | # here follows standard gnu make inference rules
|
---|
87 |
|
---|
88 | # add new dependancy on build level info
|
---|
89 | en/uni.rc : description.rc
|
---|
90 | de/uni.rc : description.rc
|
---|
91 |
|
---|
92 | # update bldlevel info
|
---|
93 | description.rc: config.kmk
|
---|
94 | @echo Writing build level informations
|
---|
95 | @cp description.rc_ description.rc
|
---|
96 | @BldLevelInf0.cmd $(VERSION) $(BUILD)
|
---|
97 |
|
---|
98 | # substitute macros in ipf file en
|
---|
99 | /en/uni.ipf: Config.kmk ./en/uni.ipf
|
---|
100 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./en/uni.ipf \
|
---|
101 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
102 | > uni_en.ipf
|
---|
103 |
|
---|
104 | # substitute macros in ipf file de
|
---|
105 | /de/uni.ipf: Config.kmk ./de/uni.ipf
|
---|
106 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./de/uni.ipf \
|
---|
107 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
108 | > uni_de.ipf
|
---|
109 |
|
---|
110 | # compile english help file
|
---|
111 | $(PATH_BIN)/en/uni.hlp: en/uni.ipf ./uni.h ./H/hmacros.h config.kmk
|
---|
112 | -gcc -E -I./h -I./en -x c uni_en.ipf > uni_en.i
|
---|
113 | -@mkdir $(PATH_BIN)
|
---|
114 | -@mkdir $(PATH_BIN)/en
|
---|
115 | $(TOOLKIT)\bin\ipfc.exe uni_en.i $(PATH_BIN)/en/uni.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
116 | rm uni_en.i
|
---|
117 | rm uni_en.ipf
|
---|
118 |
|
---|
119 | # compile german help file
|
---|
120 | $(PATH_BIN)/de/uni.hlp: de/uni.ipf ./uni.h ./H/hmacros.h config.kmk
|
---|
121 | -gcc -E -I./h -I./de -x c uni_de.ipf > uni_de.i
|
---|
122 | -@mkdir $(PATH_BIN)
|
---|
123 | -@mkdir $(PATH_BIN)/de
|
---|
124 | $(TOOLKIT)\bin\ipfc.exe uni_de.i $(PATH_BIN)/de/uni.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
125 | rm uni_de.i
|
---|
126 | rm uni_de.ipf
|
---|
127 |
|
---|
128 | # substitute macros in docs en
|
---|
129 | $(PATH_BIN)/en/readme.txt: Config.kmk en/readme.txt
|
---|
130 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" en/readme.txt \
|
---|
131 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
132 | > $(PATH_BIN)/en/readme.txt
|
---|
133 |
|
---|
134 | # substitute macros in docs de
|
---|
135 | $(PATH_BIN)/de/readme.txt: Config.kmk de/readme.txt
|
---|
136 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" de/readme.txt \
|
---|
137 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
138 | > $(PATH_BIN)/de/readme.txt
|
---|
139 |
|
---|
140 |
|
---|
141 | # final: zip all files!
|
---|
142 | $(PATH_ROOT)/dist/$(PACKAGE_NAME): \
|
---|
143 | $(PATH_BIN)/uni.pdr
|
---|
144 | $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist
|
---|
145 | $(QUIET)$(RM) -f $@
|
---|
146 | -ea2.cmd -e DEFAULT_PORT=UNI $(PATH_BIN)/en/uni.pdr
|
---|
147 | -ea2.cmd -e DEFAULT_PORT=UNI $(PATH_BIN)/de/uni.pdr
|
---|
148 | zip -9 -r $@ $(PATH_BIN)/*
|
---|
149 |
|
---|
150 |
|
---|