2005-04-21 16:53:53 +02:00
|
|
|
# Makefile for kernel
|
|
|
|
|
|
|
|
# Directories
|
|
|
|
u = /usr
|
|
|
|
i = $u/include
|
|
|
|
l = $u/lib
|
2005-06-24 18:24:40 +02:00
|
|
|
s = system
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
# Programs, flags, etc.
|
|
|
|
CC = exec cc
|
|
|
|
CPP = $l/cpp
|
|
|
|
LD = $(CC) -.o
|
2006-10-30 16:53:38 +01:00
|
|
|
CFLAGS = -I$i $(CPROFILE)
|
2005-04-21 16:53:53 +02:00
|
|
|
LDFLAGS = -i
|
|
|
|
|
|
|
|
HEAD = mpx.o
|
2006-03-15 17:15:23 +01:00
|
|
|
OBJS = start.o protect.o klib.o table.o kprintf.o main.o proc.o \
|
2006-10-30 16:53:38 +01:00
|
|
|
i8259.o exception.o system.o clock.o utility.o debug.o profile.o
|
2005-07-14 17:12:12 +02:00
|
|
|
SYSTEM = system.a
|
2006-10-30 16:53:38 +01:00
|
|
|
LIBS = -ltimers -lsysutil
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
# What to make.
|
2005-07-14 17:12:12 +02:00
|
|
|
all: build
|
|
|
|
kernel build install: $(HEAD) $(OBJS)
|
2005-04-21 16:53:53 +02:00
|
|
|
cd system && $(MAKE) -$(MAKEFLAGS) $@
|
2005-07-14 17:12:12 +02:00
|
|
|
$(LD) $(CFLAGS) $(LDFLAGS) -o kernel \
|
|
|
|
$(HEAD) $(OBJS) \
|
|
|
|
$(SYSTEM) $(LIBS)
|
|
|
|
install -S 0 kernel
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
cd system && $(MAKE) -$(MAKEFLAGS) $@
|
2005-07-19 17:01:47 +02:00
|
|
|
rm -f *.a *.o *~ *.bak kernel
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-06-24 18:24:40 +02:00
|
|
|
depend:
|
|
|
|
cd system && $(MAKE) -$(MAKEFLAGS) $@
|
2005-07-19 18:00:25 +02:00
|
|
|
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c *.s > .depend
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2006-04-10 01:16:13 +02:00
|
|
|
# How to build it
|
|
|
|
.s.o:
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2005-06-24 18:24:40 +02:00
|
|
|
# Include generated dependencies.
|
2005-07-19 18:00:25 +02:00
|
|
|
klib.o: klib386.s klib88.s
|
|
|
|
mpx.o: mpx386.s mpx88.s
|
2005-06-24 18:24:40 +02:00
|
|
|
include .depend
|
2005-04-21 16:53:53 +02:00
|
|
|
|