| [407] | 1 | ######################################################################### | 
|---|
 | 2 | # Makefile for the ALMOS-MKH "ksh" application on the TSAR architecture | 
|---|
 | 3 | ######################################################################### | 
|---|
| [230] | 4 |  | 
|---|
| [246] | 5 | CC = mipsel-unknown-elf-gcc | 
|---|
 | 6 | AS = mipsel-unknown-elf-as | 
|---|
 | 7 | LD = mipsel-unknown-elf-ld | 
|---|
 | 8 | DU = mipsel-unknown-elf-objdump | 
|---|
 | 9 | AR = mipsel-unknown-elf-ar | 
|---|
 | 10 |  | 
|---|
| [407] | 11 | LIBS = ../../libs | 
|---|
| [230] | 12 |  | 
|---|
| [407] | 13 | HAL  = ../../hal | 
|---|
 | 14 |  | 
|---|
 | 15 | KERNEL = ../../kernel | 
|---|
 | 16 |  | 
|---|
 | 17 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ | 
|---|
 | 18 |                  -fno-delete-null-pointer-checks -fomit-frame-pointer | 
|---|
 | 19 |  | 
|---|
 | 20 | OBJS = ksh.o                    \ | 
|---|
 | 21 |        $(LIBS)/build/stdlib.o   \ | 
|---|
 | 22 |        $(LIBS)/build/stdio.o    \ | 
|---|
 | 23 |        $(LIBS)/build/nostdio.o  \ | 
|---|
 | 24 |        $(LIBS)/build/string.o   \ | 
|---|
 | 25 |        $(LIBS)/build/malloc.o   \ | 
|---|
 | 26 |        $(LIBS)/build/pthread.o  \ | 
|---|
 | 27 |        $(LIBS)/build/hal_user.o | 
|---|
 | 28 |         | 
|---|
 | 29 |  | 
|---|
 | 30 | INCLUDES = -I. -I$(LIBS) -I$(KERNEL)/syscalls -I$(HAL)/generic | 
|---|
 | 31 |  | 
|---|
 | 32 | ksh.elf : $(OBJS) ksh.ld | 
|---|
 | 33 |         $(LD) -o $@ -T ksh.ld $(OBJS)  | 
|---|
 | 34 |         $(DU) -D $@ > $@.txt | 
|---|
 | 35 |  | 
|---|
 | 36 | ksh.o : ksh.c | 
|---|
 | 37 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 38 |         $(DU) -D $@ > $@.txt | 
|---|
 | 39 |  | 
|---|
 | 40 | $(LIBS)/build/hal_user.o : $(HAL)/tsar_mips32/core/hal_user.c $(HAL)/generic/hal_user.h | 
|---|
 | 41 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 42 |         $(DU) -D $@ > $@.txt | 
|---|
 | 43 |  | 
|---|
 | 44 | $(LIBS)/build/stdlib.o : $(LIBS)/stdlib.c $(LIBS)/stdlib.h | 
|---|
 | 45 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 46 |         $(DU) -D $@ > $@.txt | 
|---|
 | 47 |  | 
|---|
 | 48 | $(LIBS)/build/stdio.o : $(LIBS)/stdio.c $(LIBS)/stdio.h | 
|---|
 | 49 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 50 |         $(DU) -D $@ > $@.txt | 
|---|
 | 51 |  | 
|---|
 | 52 | $(LIBS)/build/nostdio.o : $(LIBS)/nostdio.c $(LIBS)/nostdio.h | 
|---|
 | 53 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 54 |         $(DU) -D $@ > $@.txt | 
|---|
 | 55 |  | 
|---|
 | 56 | $(LIBS)/build/string.o : $(LIBS)/string.c $(LIBS)/string.h | 
|---|
 | 57 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 58 |         $(DU) -D $@ > $@.txt | 
|---|
 | 59 |  | 
|---|
 | 60 | $(LIBS)/build/malloc.o : $(LIBS)/malloc.c $(LIBS)/malloc.h | 
|---|
 | 61 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 62 |         $(DU) -D $@ > $@.txt | 
|---|
 | 63 |  | 
|---|
 | 64 | $(LIBS)/build/pthread.o : $(LIBS)/pthread.c $(LIBS)/pthread.h | 
|---|
 | 65 |         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $< | 
|---|
 | 66 |         $(DU) -D $@ > $@.txt | 
|---|
 | 67 |  | 
|---|
| [230] | 68 | clean: | 
|---|
| [407] | 69 |         rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt | 
|---|
| [230] | 70 |  | 
|---|
| [407] | 71 |  | 
|---|