source: branches/1.0/src/makefile.kmk@ 22

Last change on this file since 22 was 22, checked in by diver, 15 years ago

reworked some stuff

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