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 = -Zomf
|
---|
43 | uni_CFLAGS.release = -s -O3 -march=pentium -mtune=pentium4
|
---|
44 | uni_CFLAGS.debug = -g -O0 -DDEBUG
|
---|
45 | uni_LDFLAGS = -Zomf -Zno-fork -Zmap -Zbin-files
|
---|
46 | uni_LDFLAGS.release = -s
|
---|
47 | uni_LDFLAGS.debug = -g
|
---|
48 |
|
---|
49 | uni_DEFS =
|
---|
50 | uni_INCS = ./h
|
---|
51 |
|
---|
52 | uni_DLLSUFF = .pdr
|
---|
53 |
|
---|
54 | uni_CLEAN = description.rc $(PATH_BIN)/uni.pdr
|
---|
55 |
|
---|
56 | #build other files en (e.g. help)
|
---|
57 | OTHERS = /en/uni.ipf $(PATH_BIN)/en/uni.hlp $(PATH_BIN)/en/readme.txt
|
---|
58 | OTHER_CLEAN = $(PATH_BIN)/en/uni.hlp $(PATH_BIN)/en/readme.txt
|
---|
59 |
|
---|
60 | #build other files de (e.g. help)
|
---|
61 | OTHERS += /de/uni.ipf $(PATH_BIN)/de/uni.hlp $(PATH_BIN)/de/readme.txt
|
---|
62 | OTHER_CLEAN += $(PATH_BIN)/de/uni.hlp $(PATH_BIN)/de/readme.txt
|
---|
63 |
|
---|
64 |
|
---|
65 | #install some more files
|
---|
66 | INSTALLS = docs
|
---|
67 | docs_INST = bin/
|
---|
68 | docs_SOURCES = uni.ico
|
---|
69 | OTHER_CLEAN += $(PATH_BIN)/uni.ico
|
---|
70 |
|
---|
71 | # packaging stuffs
|
---|
72 | ifeq ($(BUILD_TYPE),debug)
|
---|
73 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD)-debug.zip
|
---|
74 | else
|
---|
75 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD).zip
|
---|
76 | endif
|
---|
77 | PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
78 | OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
79 |
|
---|
80 | # now include standard code
|
---|
81 | include $(PATH_KBUILD)/rules.kMk
|
---|
82 |
|
---|
83 | # here follows standard gnu make inference rules
|
---|
84 |
|
---|
85 | # add new dependancy on build level info
|
---|
86 | en/uni.rc : description.rc
|
---|
87 | de/uni.rc : description.rc
|
---|
88 |
|
---|
89 | # update bldlevel info
|
---|
90 | description.rc: config.kmk
|
---|
91 | @echo Writing build level informations
|
---|
92 | @cp description.rc_ description.rc
|
---|
93 | @BldLevelInf0.cmd $(VERSION) $(BUILD)
|
---|
94 |
|
---|
95 | # substitute macros in ipf file en
|
---|
96 | /en/uni.ipf: Config.kmk ./en/uni.ipf
|
---|
97 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./en/uni.ipf \
|
---|
98 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
99 | > uni_en.ipf
|
---|
100 |
|
---|
101 | # substitute macros in ipf file de
|
---|
102 | /de/uni.ipf: Config.kmk ./de/uni.ipf
|
---|
103 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./de/uni.ipf \
|
---|
104 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
105 | > uni_de.ipf
|
---|
106 |
|
---|
107 | # compile english help file
|
---|
108 | $(PATH_BIN)/en/uni.hlp: en/uni.ipf ./uni.h config.kmk
|
---|
109 | -gcc -E -I./h -I./en -x c uni_en.ipf > uni_en.i
|
---|
110 | -@mkdir $(PATH_BIN)
|
---|
111 | -@mkdir $(PATH_BIN)/en
|
---|
112 | $(TOOLKIT)\bin\ipfc.exe uni_en.i $(PATH_BIN)/en/uni.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
113 | rm uni_en.i
|
---|
114 | rm uni_en.ipf
|
---|
115 |
|
---|
116 | # compile german help file
|
---|
117 | $(PATH_BIN)/de/uni.hlp: de/uni.ipf ./uni.h config.kmk
|
---|
118 | -gcc -E -I./h -I./de -x c uni_de.ipf > uni_de.i
|
---|
119 | -@mkdir $(PATH_BIN)
|
---|
120 | -@mkdir $(PATH_BIN)/de
|
---|
121 | $(TOOLKIT)\bin\ipfc.exe uni_de.i $(PATH_BIN)/de/uni.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
122 | rm uni_de.i
|
---|
123 | rm uni_de.ipf
|
---|
124 |
|
---|
125 | # substitute macros in docs en
|
---|
126 | $(PATH_BIN)/en/readme.txt: Config.kmk en/readme.txt
|
---|
127 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" en/readme.txt \
|
---|
128 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
129 | > $(PATH_BIN)/en/readme.txt
|
---|
130 |
|
---|
131 | # substitute macros in docs de
|
---|
132 | $(PATH_BIN)/de/readme.txt: Config.kmk de/readme.txt
|
---|
133 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" de/readme.txt \
|
---|
134 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
135 | > $(PATH_BIN)/de/readme.txt
|
---|
136 |
|
---|
137 |
|
---|
138 | # final: zip all files!
|
---|
139 | $(PATH_ROOT)/dist/$(PACKAGE_NAME): \
|
---|
140 | $(PATH_BIN)/uni.pdr
|
---|
141 | $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist
|
---|
142 | $(QUIET)$(RM) -f $@
|
---|
143 | -ea2.cmd -e DEFAULT_PORT=UNI $(PATH_BIN)/en/uni.pdr
|
---|
144 | -ea2.cmd -e DEFAULT_PORT=UNI $(PATH_BIN)/de/uni.pdr
|
---|
145 | zip -9 -r $@ $(PATH_BIN)/*
|
---|
146 |
|
---|
147 |
|
---|