source: soft/giet_vm/apps/Makefile @ 165

Last change on this file since 165 was 162, checked in by karaoui, 12 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. #
2export # export all variable to sub-Makefile
3CC      = mipsel-unknown-elf-gcc
4AS      = mipsel-unknown-elf-as
5LD      = mipsel-unknown-elf-ld
6DU      = mipsel-unknown-elf-objdump
7
8CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g
9
10TRASH= /dev/null||true
11
12LIB_COMPILE+= stdio.o
13LIB_COMPILE+= mwmr.o
14LIB_COMPILE+= common.o
15
16SOFT_PATH       = $(cd ..; shell pwd)/
17
18SYS_PATH    = $(SOFT_PATH)sys/
19BOOT_PATH   = $(SOFT_PATH)boot/
20MAP_PATH    = $(SOFT_PATH)xml/
21LIBS_PATH   = $(SOFT_PATH)libs/
22BUILD_PATH      = $(SOFT_PATH)build/
23ELF_PATH        = $(SOFT_PATH)build/
24
25INCLUDE         = -I$(LIBS_PATH) -I$(SOFT_PATH) -I$(SYS_PATH) -I$(MAP_PATH)
26
27DIRS=$(shell ls -d */ ) #list all directorys
28
29.PHONY: prepare
30
31all: test prepare $(LIB_COMPILE) 
32        set -e; for d in $(DIRS); do $(MAKE)  -C $$d ; echo "Compiling $$d";  done
33
34prepare:
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
41clean:
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.