Last change
on this file since 165 was
162,
checked in by karaoui, 13 years ago
|
Cleaning unused files
Simplifying Makefile
adding missing include
|
File size:
1.0 KB
|
Line | |
---|
1 | # Compile the library and call the Makefile of each sub-directory. # |
---|
2 | export # export all variable to sub-Makefile |
---|
3 | CC = mipsel-unknown-elf-gcc |
---|
4 | AS = mipsel-unknown-elf-as |
---|
5 | LD = mipsel-unknown-elf-ld |
---|
6 | DU = mipsel-unknown-elf-objdump |
---|
7 | |
---|
8 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g |
---|
9 | |
---|
10 | TRASH= /dev/null||true |
---|
11 | |
---|
12 | LIB_COMPILE+= stdio.o |
---|
13 | LIB_COMPILE+= mwmr.o |
---|
14 | LIB_COMPILE+= common.o |
---|
15 | |
---|
16 | SOFT_PATH = $(cd ..; shell pwd)/ |
---|
17 | |
---|
18 | SYS_PATH = $(SOFT_PATH)sys/ |
---|
19 | BOOT_PATH = $(SOFT_PATH)boot/ |
---|
20 | MAP_PATH = $(SOFT_PATH)xml/ |
---|
21 | LIBS_PATH = $(SOFT_PATH)libs/ |
---|
22 | BUILD_PATH = $(SOFT_PATH)build/ |
---|
23 | ELF_PATH = $(SOFT_PATH)build/ |
---|
24 | |
---|
25 | INCLUDE = -I$(LIBS_PATH) -I$(SOFT_PATH) -I$(SYS_PATH) -I$(MAP_PATH) |
---|
26 | |
---|
27 | DIRS=$(shell ls -d */ ) #list all directorys |
---|
28 | |
---|
29 | .PHONY: prepare |
---|
30 | |
---|
31 | all: test prepare $(LIB_COMPILE) |
---|
32 | set -e; for d in $(DIRS); do $(MAKE) -C $$d ; echo "Compiling $$d"; done |
---|
33 | |
---|
34 | prepare: |
---|
35 | @mkdir $(BUILD_PATH) 2>$(TRASH) |
---|
36 | @mkdir $(ELF_PATH) 2>$(TRASH) |
---|
37 | |
---|
38 | %.o : $(LIBS_PATH)/%.c |
---|
39 | $(CC) $(CFLAGS) $(INCLUDE) -c -o $(BUILD_PATH)/$@ $< |
---|
40 | |
---|
41 | clean: |
---|
42 | rm -f *.o |
---|
43 | set -e; for d in $(DIRS); do $(MAKE) clean -C $$d ; done |
---|
Note: See
TracBrowser
for help on using the repository browser.