source: soft/giet_vm/applications/rosenfeld/nrc2/Makefile @ 827

Last change on this file since 827 was 826, checked in by meunier, 7 years ago
  • Mise à jour NR2 et Rosenfeld
File size: 2.5 KB
Line 
1# ------------------ #
2# -- NRC Makefile -- #
3# ------------------ #
4
5# Copyright (c) 2000-2007 Lionel Lacassagne
6# with a little help of Stephane Piskorski and Joel Falcou
7
8# -- File list ----------
9FILE = nralloc1.c, nralloc2.c, nralloc2x.c, nrarith0.c, nrarith1.c, nrarith2.c, nrarith2x.c, nrbool1.c, nrbool2.c, nrio0.c, nrio1.c, nrio1x.c, nrio2.c, nrlinalg.c, nrlut.c, nrmem1.c, nrmem1x.c, nrmem2.c, nrmem2x.c, nrset1.c, nrset2.c, nrset2x.c, nrset3.c nrsort1.c, nrsort2.c, nrwrap1.c, nrwrap2.c
10#FILE := $(FILE), nrio1f.c, nrio1xf.c, nrio2f.c nrio2x.c nrio2xf.c nrio3.c # comment if giet
11
12
13TARGET ?= linux
14
15# -- Paths ----------
16SRC_PATH = src
17OBJ_PATH = obj
18INC_PATH = include
19PRODUCT = libnrc2x.a
20
21all: checktarget $(PRODUCT)
22
23ifeq ($(TARGET),giet-vm)
24
25CC      = mipsel-unknown-elf-gcc
26AR      = mipsel-unknown-elf-ar
27RANLIB  = mipsel-unknown-elf-ranlib
28AS      = mipsel-unknown-elf-as
29OD      = mipsel-unknown-elf-objdump
30OCPY    = mipsel-unknown-elf-objcopy
31LD      = mipsel-unknown-elf-ld
32NM      = mipsel-unknown-elf-nm
33
34
35C_DEBUG_FLAGS = -O0
36C_OPTIMISATION_FLAGS = -std=c99 -O2 -fstrict-aliasing
37C_OS_FLAGS = -DGTODay -DTARGET_OS=GIETVM
38C_CONFIG_FLAGS = -DCLI
39C_INC_FLAGS = -I$(INC_PATH) -I../../.. -I../../../giet_libs
40CFLAGSCPU := -mips32 -EL -G0 -mhard-float -fomit-frame-pointer -fno-builtin -ffreestanding
41
42checktarget:
43        @if [ -f $(PRODUCT) ] && objdump -f $(PRODUCT) | grep "little" > /dev/null ; then \
44                echo -ne "" ; \
45        else \
46                rm -f $(OBJS) $(PRODUCT) ;\
47        fi
48endif
49
50ifeq ($(TARGET),linux)
51
52CC = gcc
53LD = gcc
54AR = ar
55RANLIB = ranlib
56
57C_DEBUG_FLAGS = -O0
58C_OPTIMISATION_FLAGS = -std=c99 -O2 -fstrict-aliasing
59C_OS_FLAGS = -DTARGET_OS=LINUX
60C_CONFIG_FLAGS = -DCLI
61C_INC_FLAGS = -I$(INC_PATH)
62
63checktarget:
64        @if [ -f $(PRODUCT) ] && objdump -f  $(PRODUCT) | grep "86" > /dev/null ; then \
65                echo -ne "" ; \
66        else \
67                rm -f $(OBJS) $(PRODUCT) ;\
68        fi
69
70endif
71
72
73# -- Flags ----------
74CFLAGS = $(C_OPTIMISATION_FLAGS) $(C_OS_FLAGS) $(C_INC_FLAGS)
75
76
77#------------------------------------------------------------------------------
78# CC tools and parameters
79#------------------------------------------------------------------------------
80
81CFLAGSW := -Wredundant-decls -Wdisabled-optimization -Winline -Wpointer-arith -Wsign-compare -Wendif-labels
82CFLAGS := $(CFLAGS) -g -Wall $(CFLAGSW) $(CFLAGSCPU)
83
84
85
86OBJS = $(addprefix $(OBJ_PATH)/, $(addsuffix .o,$(basename $(FILE))))
87
88
89$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(INC_PATH)/*.h
90        $(CC) -c $(CFLAGS) -o $@ $<
91
92
93$(PRODUCT): $(OBJS)
94        $(AR) -cr $@ $^
95        $(RANLIB) $@
96
97clean:
98        rm -f $(OBJS)
99        rm -f $(PRODUCT)
100
Note: See TracBrowser for help on using the repository browser.