source: trunk/emx/Makefile.kmk@ 3670

Last change on this file since 3670 was 3670, checked in by bird, 15 years ago

emx/Makefile.kmk: make listomf buildable on a foreign host.

File size: 4.3 KB
Line 
1# $Id: $
2## @file
3#
4# kBuild Makefile for the EMX toolchain.
5#
6# Copyright (c) 2005-2010 knut st. osmundsen <bird-spamx@anduin.net>
7#
8#
9
10
11ifeq ($(KBUILD_HOST),os2)
12LIBRARIES = \
13 libmoddef \
14 libomflib \
15 libend
16
17PROGRAMS = \
18 emxbind \
19 emxcat \
20 emxexp \
21 emximp \
22 emxload \
23 emxomf \
24 emxomfar \
25 emxomfld \
26 listomf \
27 stripomf \
28 emxaout \
29 emxstack \
30 emxtsf \
31 emxupd \
32 ld \
33 ldstub
34
35INSTALLS = \
36 os2stub.bin \
37 scripts \
38 headers.sys
39else
40PROGRAMS = \
41 listomf
42endif
43
44#
45# Globals
46#
47INCS = include
48DEFS = VERSION=\"x\" INNOTEK_VERSION=\"y\"
49
50
51#
52# libmoddef
53#
54libmoddef_TEMPLATE = usr.lib
55libmoddef_SOURCES = \
56 src/libmoddef/moddef1.c \
57 src/libmoddef/moddef2.c \
58 src/libmoddef/moddef3.c
59
60#
61# libomflib
62#
63libomflib_TEMPLATE = usr.lib
64libomflib_SOURCES = \
65 src/libomflib/omflibam.c \
66 src/libomflib/omflibap.c \
67 src/libomflib/omflibcl.c \
68 src/libomflib/omflibcp.c \
69 src/libomflib/omflibcr.c \
70 src/libomflib/omflibdl.c \
71 src/libomflib/omflibex.c \
72 src/libomflib/omflibpb.c \
73 src/libomflib/omflibrd.c \
74 src/libomflib/omflibut.c \
75 src/libomflib/omflibwr.c
76
77#
78# libend
79#
80libend_TEMPLATE = usr.lib.nasm
81libend_SOURCES = \
82 src/libend/x86/end.asm \
83 src/libend/x86/endtext.asm \
84 src/libend/x86/enddata.asm \
85 src/libend/x86/endlink386.asm \
86 src/libend/x86/weakzero.asm
87
88#
89# emxbind
90#
91emxbind_TEMPLATE = usr.bin
92emxbind_DEFS = _BSD_NAMESPACE_POLLUTION
93emxbind_SOURCES = \
94 src/emxbind/cmd.c \
95 src/emxbind/emxbind.c \
96 src/emxbind/exec.c \
97 src/emxbind/export.c \
98 src/emxbind/fixup.c \
99 src/emxbind/map.c \
100 src/emxbind/resource.c \
101 src/emxbind/utils.c
102emxbind_LIBS = \
103 $(TARGET_libmoddef)
104
105#
106# The MZ stub.
107#
108os2stub.bin_TEMPLATE = usr.bin
109os2stub.bin_SOURCES = \
110 src/emxbind/os2stub.bin
111
112#
113# emxcat
114#
115emxcat_TEMPLATE = usr.bin
116emxcat_SOURCES = \
117 src/emxcat/emxcat.c
118
119#
120# emxdoc - skipped
121#
122
123#
124# emxexp
125#
126emxexp_TEMPLATE = usr.bin
127emxexp_SOURCES = \
128 src/emxexp/emxexp.c
129emxexp_LIBS = \
130 $(TARGET_libomflib) \
131 iberty
132
133#
134# emximp
135#
136emximp_TEMPLATE = usr.bin
137emximp_SOURCES = \
138 src/emximp/emximp.c
139emximp_LIBS = \
140 $(TARGET_libomflib) \
141 $(TARGET_libmoddef)
142
143#
144# emxload
145#
146emxload_TEMPLATE = usr.bin
147emxload_SOURCES = \
148 src/emxload/emxload.c
149
150#
151# emxomf
152#
153emxomf_TEMPLATE = usr.bin
154emxomf_SOURCES = \
155 src/emxomf/emxomf.c \
156 src/emxomf/stabshll.c \
157 src/emxomf/grow.c
158emxomf_LIBS = \
159 $(TARGET_libomflib) \
160 iberty
161
162#
163# emxomfar
164#
165emxomfar_TEMPLATE = usr.bin
166emxomfar_SOURCES = \
167 src/emxomf/emxomfar.c
168emxomfar_LIBS = \
169 $(TARGET_libomflib)
170
171#
172# emxomfld
173#
174emxomfld_TEMPLATE = usr.bin
175emxomfld_SOURCES = \
176 src/emxomf/emxomfld.c \
177 src/emxomf/weakld.c \
178 src/emxomf/grow.c
179emxomfld_LIBS = \
180 $(TARGET_libmoddef)
181
182#
183# listomf
184#
185listomf_TEMPLATE = usr.bin
186listomf_SOURCES = \
187 src/emxomf/listomf.c
188
189#
190# stripomf
191#
192stripomf_TEMPLATE = usr.bin
193stripomf_SOURCES = \
194 src/emxomf/stripomf.c
195
196#
197# emxaout
198#
199emxaout_TEMPLATE = usr.bin
200emxaout_SOURCES = \
201 src/emxomf/emxaout.c \
202 src/emxomf/grow.c
203
204#
205# emxstack
206#
207emxstack_TEMPLATE = usr.bin
208emxstack_SOURCES = \
209 src/emxstack/emxstack.c
210
211#
212# emxtsf
213#
214emxtsf_TEMPLATE = usr.bin
215emxtsf_SOURCES = \
216 src/emxtsf/emxtsf.c
217emxtsf_LIBS = \
218 $(TARGET_libmoddef)
219
220#
221# emxupd
222#
223emxupd_TEMPLATE = usr.bin
224emxupd_SOURCES = \
225 src/emxupd/emxupd.c
226
227#
228# ld (good old one)
229#
230ld_TEMPLATE = usr.bin
231ld_DEFS = EMX USE_ALLOCA
232ld_SOURCES = \
233 src/ld/ld.c
234ld_LDFLAGS = -Zstack 24575
235ld_LIBS = \
236 iberty
237
238#
239# ldstub
240#
241if 0
242ldstub_TEMPLATE = usr.bin.alp
243ldstub_SOURCES = \
244 src/ld/ldstub.asm \
245 src/ld/ldstub.def
246ldstub_LDFLAGS = -nostdlib -s #-Wl,-O,Option,-O,alignment=1
247ldstub_LIBS = os2 end
248else
249ldstub_TEMPLATE = usr.bin.nasm
250ldstub_SOURCES = \
251 src/ld/ldstub-nasm.asm \
252 src/ld/ldstub.def
253ldstub_ASFLAGS = -Ox
254ldstub_LDFLAGS = -nostdlib -s
255ldstub_LIBS = os2
256endif
257ldstub_EXESUFF =
258
259#
260# Scripts
261#
262scripts_TEMPLATE = usr.bin.script
263scripts_SOURCES = \
264 src/misc/dllar.cmd \
265 src/misc/gccenv.cmd \
266 src/misc/MakeOmfLibs.cmd
267
268#
269# Headers - include/sys
270#
271headers.sys_TEMPLATE = usr.include.sys
272headers.sys_SOURCES = \
273 include/sys/moddef.h \
274 include/sys/omflib.h
275
276
277DEPTH = ..
278include $(PATH_KBUILD)/rules.kmk
279
Note: See TracBrowser for help on using the repository browser.