source: soft/giet_vm/applications/ocean/Makefile.config.giet @ 759

Last change on this file since 759 was 589, checked in by alain, 9 years ago

Modify all applications to support two new rules:
1) introduce a local Makefile for each application.
2) change "application.elf" name to "application/appli.elf" name in the application.py" file.
Introduce the shell application.

File size: 1.8 KB
RevLine 
[581]1
2#------------------------------------------------------------------------------
3# Default plateform architecture and default CPU
4#------------------------------------------------------------------------------
[589]5GIET_DISTRIB= ../..
[581]6
7#------------------------------------------------------------------------------
8# CC tools and parameters
9#------------------------------------------------------------------------------
10DIR_INC  = $(GIET_DISTRIB)/giet_libs
11DIR_LIB  = $(GIET_DISTRIB)/build/libs
12
13OBJ=$(DIR_LIB)/malloc.o $(DIR_LIB)/stdio.o $(DIR_LIB)/user_barrier.o $(DIR_LIB)/user_lock.o $(DIR_LIB)/stdlib.o $(DIR_LIB)/user_sqt_lock.o
14
15
16BASEDIR := $(PWD)
17MACROS := $(BASEDIR)/null_macros/c.m4.null.GIET
18M4 := m4 -s -Ulen -Uindex
19
20CFLAGSW := -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization -Winline -Wpointer-arith -Wsign-compare -Wendif-labels
21CFLAGSCPU = -mips32 -EL -G0 -mhard-float
22CFLAGS := $(CFLAGS) -O2 -g -Wall -fomit-frame-pointer $(CFLAGSW) $(CFLAGSCPU) -I$(DIR_INC) -I$(GIET_DISTRIB)
23
24
25ifneq ($(ADD-LDSCRIPT),)
26LDSCRIPT=$(ADD-LDSCRIPT)
27else
28LDSCRIPT=ocean.ld
29endif
30
[584]31LDFLAGS := $(LDFLAGS) -L$(DIR_LIB) $(CPU-LFLAGS) -T$(LDSCRIPT) -lmath $(OBJ) $(ADD-LIBS)
[581]32
33
34
35
36ifeq ($(TARGET),)
37        $(error *** Error: Variable TARGET must be defined before calling Makefile.config)
38endif
39
40ifeq ($(OBJS),)
41        $(error *** Error: Variable OBJS must be defined before calling Makefile.config)
42endif
43
44
45
46#------------------------------------------------------------------------------
47# Building rules
48#------------------------------------------------------------------------------
49
50.PHONY: clean
51
52
53all: $(TARGET)
54
55$(TARGET): $(OBJS)
56        $(LD) -o $@ $^ $(LDFLAGS)
57
58%.h: %.H
59        $(M4) $(MACROS) $< > $@
60
61%.c: %.C $(MACROS)
62        $(M4) $(MACROS) $< > $@
63
64%.o: %.c $(MACROS)
65        $(CC) -c $(CFLAGS) -o $@ $<
66
67
68clean:
[589]69        rm -f *.c *.h *.o *.pyc *.elf *.txt core *~
[581]70
71
72
Note: See TracBrowser for help on using the repository browser.