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

Last change on this file since 583 was 581, checked in by laurent, 9 years ago

Adding ocean application, some mathematics functions and distributed locks

File size: 2.5 KB
Line 
1
2#------------------------------------------------------------------------------
3# Default plateform architecture and default CPU
4#------------------------------------------------------------------------------
5CPU         = mipsel
6CCTOOLS     = /opt/mipsel-toolchain
7GIET_DISTRIB= $(PWD)/../..
8
9#------------------------------------------------------------------------------
10# CC tools and parameters
11#------------------------------------------------------------------------------
12DIR_INC  = $(GIET_DISTRIB)/giet_libs
13DIR_LIB  = $(GIET_DISTRIB)/build/libs
14GCC_LIB  = $(CCTOOLS)/lib
15CC       = $(CCTOOLS)/bin/$(CPU)-unknown-elf-gcc
16AR       = $(CCTOOLS)/bin/$(CPU)-unknown-elf-ar
17AS       = $(CCTOOLS)/bin/$(CPU)-unknown-elf-as
18OD       = $(CCTOOLS)/bin/$(CPU)-unknown-elf-objdump
19OCPY     = $(CCTOOLS)/bin/$(CPU)-unknown-elf-objcopy
20LD       = $(CCTOOLS)/bin/$(CPU)-unknown-elfld
21NM       = $(CCTOOLS)/bin/$(CPU)-unknown-elf-nm
22
23OBJ=$(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
24
25
26BASEDIR := $(PWD)
27MACROS := $(BASEDIR)/null_macros/c.m4.null.GIET
28M4 := m4 -s -Ulen -Uindex
29
30CFLAGSW := -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization -Winline -Wpointer-arith -Wsign-compare -Wendif-labels
31CFLAGSCPU = -mips32 -EL -G0 -mhard-float
32CFLAGS := $(CFLAGS) -O2 -g -Wall -fomit-frame-pointer $(CFLAGSW) $(CFLAGSCPU) -I$(DIR_INC) -I$(GIET_DISTRIB)
33
34
35ifneq ($(ADD-LDSCRIPT),)
36LDSCRIPT=$(ADD-LDSCRIPT)
37else
38LDSCRIPT=ocean.ld
39endif
40
41#LDFLAGS := $(LDFLAGS) -L$(DIR_LIB) -L$(GCC_LIB) $(CPU-LFLAGS) -T$(LDSCRIPT) $(OBJ) $(ADD-LIBS) \
42#       -lpthread -lgomp -lc $(ADD-LIBS) -lgomp -lpthread -lm -lc -lgcc --hash-style=sysv
43LDFLAGS := $(LDFLAGS) -L$(DIR_LIB) -L$(GCC_LIB) $(CPU-LFLAGS) -T$(LDSCRIPT) -lmath $(OBJ) $(ADD-LIBS)
44
45
46
47
48ifeq ($(TARGET),)
49        $(error *** Error: Variable TARGET must be defined before calling Makefile.config)
50endif
51
52ifeq ($(OBJS),)
53        $(error *** Error: Variable OBJS must be defined before calling Makefile.config)
54endif
55
56ifneq ($(CPU),mipsel)
57        $(error *** Error: Variable CPU must be equal to \'mipsel\' when calling this Makefile)
58endif
59
60
61
62#------------------------------------------------------------------------------
63# Building rules
64#------------------------------------------------------------------------------
65
66.PHONY: clean
67
68
69all: $(TARGET)
70
71$(TARGET): $(OBJS)
72        $(LD) -o $@ $^ $(LDFLAGS)
73
74%.h: %.H
75        $(M4) $(MACROS) $< > $@
76
77%.c: %.C $(MACROS)
78        $(M4) $(MACROS) $< > $@
79
80%.o: %.c $(MACROS)
81        $(CC) -c $(CFLAGS) -o $@ $<
82
83
84clean:
85        $(RM) -f *.c *.h *.o *.pyc $(TARGET)
86
87
88
Note: See TracBrowser for help on using the repository browser.