better makefiles

This commit is contained in:
Oliver Lehmann 2009-08-21 20:06:11 +00:00
parent a6a7c22c5b
commit ea031d3631
3 changed files with 22 additions and 23 deletions

View File

@ -1,34 +1,34 @@
OBJ= timer.o rtc72421.o u130.o gmtime.o timegm.o
M= ../common
CC= scc
INCLUDES= -I$(M)
CFLAGS= -O
CC_CMD= $(CC) -c $(CFLAGS) $(INCLUDES)
CFLAGS= -O -I$(M)
CC_CMD= $(CC) -c $(CFLAGS)
all: kernel
u130.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/u130.c
rtc72421.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/rtc72421.c
gmtime.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/gmtime.c
timegm.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/timegm.c
kernel: $(OBJ)
touch kernel
install: kernel
@echo "I will now include the new objects in the kernel library LIB1."
@echo "A backup of the old LIB1 can be found here: /usr/sys/sys/LIB1.orig"
if test ! -f /usr/sys/sys/LIB1.orig ; \
sh -c 'if test ! -f /usr/sys/sys/LIB1.orig ; then \
cp /usr/sys/sys/LIB1 /usr/sys/sys/LIB1.orig ; \
fi
ar rv /usr/sys/sys/LIB1 timer.o rtc72421.o u130.o gmtime.o timegm.o
@echo "You should now go and build a new WEGA kernel to get the RTC up and running!"
fi'
ar rv /usr/sys/sys/LIB1 $(OBJ)
@echo "You should now go and build a new WEGA kernel to get the RTC up and running"
clean:
rm -f $(OBJ)
rm -f $(OBJ) kernel

View File

@ -1,11 +1,11 @@
all: sa.timer kernel
all: sa.timer kern
sa.timer:
cd standalone ; make all
instsa:
cd standalone ; make install
kernel:
kern:
cd kernel ; make all
instkern:

View File

@ -2,23 +2,22 @@ OBJ= sa.timer.o u130.o rtc72421.o gmtime.o timegm.o
M= ../common
CC= cc
LD= ld
INCLUDES= -I$(M)
CFLAGS= -O
CC_CMD= $(CC) -c $(CFLAGS) $(INCLUDES)
CFLAGS= -O -I$(M)
CC_CMD= $(CC) -c $(CFLAGS)
all: sa.timer
u130.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/u130.c
rtc72421.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/rtc72421.c
gmtime.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/gmtime.c
timegm.o:
$(CC_CMD) $(M)/$*.c
$(CC_CMD) $(M)/timegm.c
sa.timer: $(OBJ) libb.a
$(LD) -s -o $@ $(OBJ) libb.a
@ -26,9 +25,9 @@ sa.timer: $(OBJ) libb.a
install: sa.timer
@echo "A backup of the old sa.timer can be found here: /sa.timer.orig"
if test ! -f /sa.timer.orig ; \
sh -c 'if test ! -f /sa.timer.orig ; then \
cp /sa.timer /sa.timer.orig ; \
fi
fi'
cp sa.timer /sa.timer
clean: