source: trunk/user/ksh/Makefile @ 417

Last change on this file since 417 was 407, checked in by alain, 7 years ago

First implementation of fork/exec.

File size: 2.0 KB
RevLine 
[407]1#########################################################################
2# Makefile for the ALMOS-MKH "ksh" application on the TSAR architecture
3#########################################################################
[230]4
[246]5CC = mipsel-unknown-elf-gcc
6AS = mipsel-unknown-elf-as
7LD = mipsel-unknown-elf-ld
8DU = mipsel-unknown-elf-objdump
9AR = mipsel-unknown-elf-ar
10
[407]11LIBS = ../../libs
[230]12
[407]13HAL  = ../../hal
14
15KERNEL = ../../kernel
16
17CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \
18                 -fno-delete-null-pointer-checks -fomit-frame-pointer
19
20OBJS = 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
30INCLUDES = -I. -I$(LIBS) -I$(KERNEL)/syscalls -I$(HAL)/generic
31
32ksh.elf : $(OBJS) ksh.ld
33        $(LD) -o $@ -T ksh.ld $(OBJS) 
34        $(DU) -D $@ > $@.txt
35
36ksh.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]68clean:
[407]69        rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt
[230]70
[407]71
Note: See TracBrowser for help on using the repository browser.