Last change
on this file since 662 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
|
Rev | Line | |
---|
[581] | 1 | |
---|
| 2 | #------------------------------------------------------------------------------ |
---|
| 3 | # Default plateform architecture and default CPU |
---|
| 4 | #------------------------------------------------------------------------------ |
---|
[589] | 5 | GIET_DISTRIB= ../.. |
---|
[581] | 6 | |
---|
| 7 | #------------------------------------------------------------------------------ |
---|
| 8 | # CC tools and parameters |
---|
| 9 | #------------------------------------------------------------------------------ |
---|
| 10 | DIR_INC = $(GIET_DISTRIB)/giet_libs |
---|
| 11 | DIR_LIB = $(GIET_DISTRIB)/build/libs |
---|
| 12 | |
---|
| 13 | OBJ=$(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 | |
---|
| 16 | BASEDIR := $(PWD) |
---|
| 17 | MACROS := $(BASEDIR)/null_macros/c.m4.null.GIET |
---|
| 18 | M4 := m4 -s -Ulen -Uindex |
---|
| 19 | |
---|
| 20 | CFLAGSW := -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization -Winline -Wpointer-arith -Wsign-compare -Wendif-labels |
---|
| 21 | CFLAGSCPU = -mips32 -EL -G0 -mhard-float |
---|
| 22 | CFLAGS := $(CFLAGS) -O2 -g -Wall -fomit-frame-pointer $(CFLAGSW) $(CFLAGSCPU) -I$(DIR_INC) -I$(GIET_DISTRIB) |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | ifneq ($(ADD-LDSCRIPT),) |
---|
| 26 | LDSCRIPT=$(ADD-LDSCRIPT) |
---|
| 27 | else |
---|
| 28 | LDSCRIPT=ocean.ld |
---|
| 29 | endif |
---|
| 30 | |
---|
[584] | 31 | LDFLAGS := $(LDFLAGS) -L$(DIR_LIB) $(CPU-LFLAGS) -T$(LDSCRIPT) -lmath $(OBJ) $(ADD-LIBS) |
---|
[581] | 32 | |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | ifeq ($(TARGET),) |
---|
| 37 | $(error *** Error: Variable TARGET must be defined before calling Makefile.config) |
---|
| 38 | endif |
---|
| 39 | |
---|
| 40 | ifeq ($(OBJS),) |
---|
| 41 | $(error *** Error: Variable OBJS must be defined before calling Makefile.config) |
---|
| 42 | endif |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | #------------------------------------------------------------------------------ |
---|
| 47 | # Building rules |
---|
| 48 | #------------------------------------------------------------------------------ |
---|
| 49 | |
---|
| 50 | .PHONY: clean |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | all: $(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 | |
---|
| 68 | clean: |
---|
[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.