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_SOURCES = \
|
---|
27 | rc/uni.rc \
|
---|
28 | uni.def \
|
---|
29 | uni.c
|
---|
30 |
|
---|
31 | uni_CFLAGS = -Zomf
|
---|
32 | uni_CFLAGS.release = -s -O3 -march=pentium -mcpu=pentium4
|
---|
33 | uni_CFLAGS.debug = -g -O0 -DDEBUG
|
---|
34 | uni_LDFLAGS = -Zomf -Zno-fork -Zmap -Zbin-files
|
---|
35 | uni_LDFLAGS.release = -s
|
---|
36 | uni_LDFLAGS.debug = -g
|
---|
37 |
|
---|
38 | uni_DEFS =
|
---|
39 | uni_INCS = ./h ./rc
|
---|
40 |
|
---|
41 | uni_DLLSUFF = .pdr
|
---|
42 |
|
---|
43 | uni_CLEAN = /rc/description.rc $(PATH_BIN)/uni.pdr
|
---|
44 |
|
---|
45 | #build other files (e.g. help)
|
---|
46 | OTHERS = /rc/uni.ipf $(PATH_BIN)/uni.hlp $(PATH_BIN)/readme.txt
|
---|
47 | OTHER_CLEAN = $(PATH_BIN)/uni.hlp $(PATH_BIN)/readme.txt
|
---|
48 |
|
---|
49 | #install some more files
|
---|
50 | INSTALLS = docs
|
---|
51 | docs_INST = bin/
|
---|
52 | docs_SOURCES = uni.ico
|
---|
53 | OTHER_CLEAN += $(PATH_BIN)/uni.ico
|
---|
54 |
|
---|
55 | # packaging stuffs
|
---|
56 | ifeq ($(BUILD_TYPE),debug)
|
---|
57 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD)-debug.zip
|
---|
58 | else
|
---|
59 | PACKAGE_NAME = uni-$(subst .,_,$(VERSION))-$(BUILD).zip
|
---|
60 | endif
|
---|
61 | PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
62 | OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME)
|
---|
63 |
|
---|
64 | # now include standard code
|
---|
65 | include $(PATH_KBUILD)/rules.kMk
|
---|
66 |
|
---|
67 | # here follows standard gnu make inference rules
|
---|
68 |
|
---|
69 | # add new dependancy on build level info
|
---|
70 | rc/uni.rc : rc/description.rc
|
---|
71 |
|
---|
72 | # update bldlevel info
|
---|
73 | rc/description.rc: config.kmk
|
---|
74 | @echo Writing build level informations
|
---|
75 | @cp rc/description.rc_ rc/description.rc
|
---|
76 | @BldLevelInf0.cmd $(VERSION) $(BUILD)
|
---|
77 |
|
---|
78 | # substitute macros in ipf file
|
---|
79 | /rc/uni.ipf: Config.kmk ./rc/uni.ipf
|
---|
80 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" ./rc/uni.ipf \
|
---|
81 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
82 | > uni.ipf
|
---|
83 |
|
---|
84 | # compile english help file
|
---|
85 | $(PATH_BIN)/uni.hlp: uni.ipf ./uni.h ./H/hmacros.h config.kmk
|
---|
86 | -gcc -E -I./h -I./rc -x c uni.ipf > uni.i
|
---|
87 | -@mkdir $(PATH_BIN)
|
---|
88 | $(TOOLKIT)\bin\ipfc.exe uni.i $(PATH_BIN)/uni.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
89 | rm uni.i
|
---|
90 | rm uni.ipf
|
---|
91 |
|
---|
92 |
|
---|
93 | # substitute macros in docs
|
---|
94 | $(PATH_BIN)/readme.txt: Config.kmk readme.txt
|
---|
95 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" readme.txt \
|
---|
96 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
97 | > $(PATH_BIN)/readme.txt
|
---|
98 |
|
---|
99 | # final: zip all files!
|
---|
100 | $(PATH_ROOT)/dist/$(PACKAGE_NAME): \
|
---|
101 | $(PATH_BIN)/uni.pdr
|
---|
102 | $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist
|
---|
103 | $(QUIET)$(RM) -f $@
|
---|
104 | -ea2.cmd -e DEFAULT_PORT=UNI $(PATH_BIN)/uni.pdr
|
---|
105 | $(QUIET)zip -9 -j $@ $(PATH_BIN)/*
|
---|
106 |
|
---|
107 |
|
---|