source: soft/giet_vm/apps/Makefile @ 161

Last change on this file since 161 was 161, checked in by karaoui, 12 years ago

Deleting unused folders
All ELF file have the extension *.elf
Must objetc file are now dumped in the build directory

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