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

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

reworked some stuff

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