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

Last change on this file since 824 was 823, checked in by meunier, 9 years ago
  • Improved scripts for simulations and graphes
  • Continued to clean up the lib nrc2 (from nrio2x.x to nrmem1.c)
  • Added a version (Fast - Parmerge - No stats)
File size: 2.5 KB
RevLine 
[772]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 ----------
[822]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, nrsort1.c, nrsort2.c, nrwrap1.c, nrwrap2.c
[823]10FILE := $(FILE), nrio1f.c, nrio1xf.c, nrio2f.c nrio2x.c nrio2xf.c nrio3.c # comment if giet
[772]11
12
[821]13TARGET ?= linux
[772]14
15# -- Paths ----------
16SRC_PATH = src
17OBJ_PATH = obj
18INC_PATH = include
[822]19PRODUCT = libnrc2x.a
[772]20
[822]21all: checktarget $(PRODUCT)
22
[821]23ifeq ($(TARGET),giet-vm)
[772]24
[821]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
[772]35C_DEBUG_FLAGS = -O0
36C_OPTIMISATION_FLAGS = -std=c99 -O2 -fstrict-aliasing
[798]37C_OS_FLAGS = -DGTODay -DTARGET_OS=GIETVM
[772]38C_CONFIG_FLAGS = -DCLI
39C_INC_FLAGS = -I$(INC_PATH) -I../../.. -I../../../giet_libs
[821]40CFLAGSCPU := -mips32 -EL -G0 -mhard-float
[772]41
[822]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
[821]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 = -DGTODay -DTARGET_OS=LINUX
60C_CONFIG_FLAGS = -DCLI
61C_INC_FLAGS = -I$(INC_PATH)
62
[822]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
[821]70endif
71
72
[772]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
[798]82CFLAGS := $(CFLAGS) -g -Wall -fomit-frame-pointer $(CFLAGSW) $(CFLAGSCPU) -fno-builtin -ffreestanding
[772]83
84
85
86OBJS = $(addprefix $(OBJ_PATH)/, $(addsuffix .o, $(basename $(FILE))))
87
88
[822]89$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(INC_PATH)/*.h
[772]90        $(CC) -c $(CFLAGS) -o $@ $<
91
92
93$(PRODUCT): $(OBJS)
[821]94        $(AR) -cr $@ $^
[793]95        $(RANLIB) $@ 
[772]96
97clean:
98        rm -f $(OBJS)
99        rm -f $(PRODUCT)
100
Note: See TracBrowser for help on using the repository browser.