really revert endpoint_t -> int
[minix.git] / kernel / Makefile
blobb4e9f81ab8ed94fd4fc8caed42d9f154828af0da
1 # Makefile for kernel
3 include /etc/make.conf
5 # Directories
6 u = /usr
7 i = $u/include
8 l = $u/lib
9 s = system
10 a = arch/$(ARCH)
12 # Programs, flags, etc.
13 CC = exec cc
14 CPP = $l/cpp
15 LD = $(CC) -.o
16 CPPFLAGS=-I$i -I$a/include -I$a
17 CFLAGS=$(CPROFILE) $(CPPFLAGS) $(EXTRA_OPTS)
18 LDFLAGS=-i
20 # first-stage, arch-dependent startup code
21 HEAD = $a/mpx386.o
23 OBJS = start.o table.o main.o proc.o \
24 system.o clock.o utility.o debug.o profile.o interrupt.o
25 SYSTEM = system.a
26 ARCHLIB = $a/$(ARCH).a
27 LIBS = -ltimers -lsys
29 # What to make.
30 all: build
31 kernel build install: $(OBJS)
32 cd system && $(MAKE) $@
33 cd $a && $(MAKE) $@
34 $(LD) $(CFLAGS) $(LDFLAGS) -o kernel $(HEAD) $(OBJS) \
35 $(SYSTEM) $(ARCHLIB) $(LIBS)
36 install -S 0 kernel
38 clean:
39 cd system && $(MAKE) -$(MAKEFLAGS) $@
40 cd $a && $(MAKE) -$(MAKEFLAGS) $@
41 rm -f *.a *.o *~ *.bak kernel
43 depend:
44 cd system && $(MAKE) -$(MAKEFLAGS) $@
45 cd $a && $(MAKE) $@
46 mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
48 # How to build it
49 .c.o:
50 $(CC) $(CFLAGS) -c -o $@ $<
52 # Include generated dependencies.
53 include .depend