summaryrefslogtreecommitdiff
path: root/i386/Makefile.in
blob: fdd04f201252247c82d2c5c52c1f1ab12d8a15c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Makefile for i386
# Copyright 1999, 2006 Free Software Foundation, Inc.
#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
#
# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
# "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.


#
# configure's findings.
#

srcdir = @srcdir@

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
bootdir = $(exec_prefix)/boot
datadir = @datadir@
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@

top_srcdir = @srcdir@/..
top_builddir = ../


#
# Default target
#

all:


# Detect if the user wants LPR
ifeq ($(findstring -DMACH_LPR,@DEFS@),-DMACH_LPR)
enable_lpr=yes
else
enable_lpr=no
endif


# i386 Mach makefile fragment
# Copyright 1997, 1999 Free Software Foundation, Inc.
#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
#
# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
# "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.


# Source files for any i386 kernel
i386at-files = autoconf.c blit.c conf.c cons_conf.c rtc.c \
	i386at_ds_routines.c immc.c int_init.c iopl.c kd.c kd_event.c \
	kd_mouse.c kd_queue.c model_dep.c pic_isa.c
i386-files = ast_check.c db_disasm.c db_interface.c db_trace.c debug_i386.c \
	fpe_linkage.c fpu.c gdt.c hardclock.c idt.c io_emulate.c io_map.c \
	iopb.c ktss.c kttd_interface.c ldt.c loose_ends.c mp_desc.c pcb.c \
	phys.c pic.c pit.c seg.c trap.c user_ldt.c
intel-files = pmap.c read_fault.c

# Assembler source
i386at-Sfiles = boothdr.S interrupt.S kdasm.S
i386-Sfiles = cswitch.S debug_trace.S idt_inittab.S locore.S spl.S

# Account for them in the image
objfiles += $(subst .c,.o,$(i386at-files) $(i386-files) $(intel-files)) \
	    $(subst .S,.o,$(i386at-Sfiles) $(i386-Sfiles))
vpath %.c $(srcdir)/i386at $(srcdir)/i386 $(srcdir)/intel
vpath %.S $(srcdir)/i386at $(srcdir)/i386

# Files from the generic source that we want
objfiles += busses.o cirbuf.o
# Hm.
vpath busses.c $(top_srcdir)/chips
vpath cirbuf.c $(top_srcdir)/device

# Mig-generated
objfiles += mach_i386_server.o

servers = $(filter %_server.o,$(objfiles))

# This file is only needed for KDB support.  It'll be discarded at linking time
# if it's not needed.
objfiles += _setjmp.o

# XXX: In i386, com is always enabled.
objfiles += com.o

# This file is only needed for LPR support.
ifeq ($(enable_lpr),yes)
objfiles += lpr.o
endif



# Where to find some things
vpath i386asm.sym $(srcdir)/i386
vpath mach_i386.srv $(srcdir)/i386

# Our include files; they precede the generic ones.
INCLUDES = -I. -I$(srcdir)/i386at -I$(srcdir)/i386 \
	-I$(srcdir)/include -I$(srcdir)/include/mach/sa \
	-I$(srcdir)/bogus -I$(srcdir)


#
# Rules.
#

all: sysdep.a
	$(MAKE) -C linux $@

# `boothdr.o' is special.
sysdep.a: $(objfiles) linux/linux.o
	rm -f $@
	$(AR) cr $@ $(filter-out boothdr.o,$^)
	$(RANLIB) $@

check:
	$(MAKE) -C linux $@

clean:
	$(MAKE) -C linux $@
	rm -f sysdep.a
	rm -f $(objfiles) $(subst .o,.d,$(objfiles))
	rm -f *.symc *.symc.o *_user.c *_server.c *.h
	rm -f *.migs_d *.migsh_d *.migu_d *.miguh_d

distclean: clean
	$(MAKE) -C linux $@
	rm -f Makefile Makerules
	rm -f config.status config.log

mostlyclean: distclean
	$(MAKE) -C linux $@

maintainer-clean: mostlyclean
	$(MAKE) -C linux $@
	rm -f $(srcdir)/configure

linux/%: FORCE
	$(MAKE) -C linux $(@F)
FORCE:


#
# Installation
#

install:
	make -C linux $@

installed-headers = $(addprefix mach/i386/, \
	asm.h boolean.h disk.h eflags.h exception.h fp_reg.h ioccom.h \
	kern_return.h mach_i386.defs mach_i386_types.h machine_types.defs \
	multiboot.h rpc.h syscall_sw.h thread_status.h trap.h vm_param.h \
	vm_types.h)

installed-headers-names = $(addprefix $(includedir)/,$(installed-headers))
$(installed-headers-names): $(includedir)/%: $(srcdir)/include/%
	$(INSTALL_DATA) $< $@

install-headers: mkheaderdirs $(installed-headers-names)
	ln -sfn $(systype) $(includedir)/mach/machine
	make -C linux $@

install-kernel:
	make -C linux $@

mkheaderdirs:
	mkdir -p $(includedir)/mach/$(systype)


#
# Autoconf support
#

$(srcdir)/configure: configure.in
	cd $(srcdir) && autoconf

Makefile: Makefile.in config.status
	./config.status $@

config.status: configure
	./config.status --recheck

vpath %.in $(srcdir)
vpath configure $(srcdir)


#
# Makerules
#

include $(top_builddir)/Makerules