[772] | 1 | |
---|
| 2 | # -- Paths ---------- |
---|
[805] | 3 | SRC_PATH = src-par |
---|
[772] | 4 | OBJ_PATH = obj |
---|
| 5 | INC_PATH = include |
---|
| 6 | |
---|
[798] | 7 | TARGET ?= linux |
---|
[823] | 8 | IGNORE_ASSERT ?= false |
---|
| 9 | |
---|
[798] | 10 | # |
---|
| 11 | # -- Config ---------- |
---|
[772] | 12 | |
---|
[798] | 13 | ifeq ($(TARGET),giet-vm) |
---|
| 14 | |
---|
[772] | 15 | C_OPTIM_FLAGS = -std=c99 -O2 -fstrict-aliasing |
---|
[798] | 16 | C_OS_FLAGS = -DGTODay -DTARGET_OS=GIETVM |
---|
[772] | 17 | C_CONFIG_FLAGS = -DCLI |
---|
| 18 | C_INC_FLAGS = -I$(INC_PATH) -Inrc2/include -I../.. -I../../giet_libs -I../../giet_xml/ |
---|
[823] | 19 | CFLAGSCPU = -mips32 -EL -G0 -mhard-float -fomit-frame-pointer -fno-builtin -ffreestanding |
---|
[772] | 20 | |
---|
[823] | 21 | LDFLAGS = -Lnrc2 -L../../build/libs -Trosenfeld.ld --start-group -lnrc2x -luser -lmath --end-group |
---|
[798] | 22 | |
---|
| 23 | endif |
---|
| 24 | |
---|
| 25 | ifeq ($(TARGET),linux) |
---|
| 26 | |
---|
| 27 | CC = gcc |
---|
| 28 | LD = gcc |
---|
| 29 | |
---|
| 30 | # -- Config ---------- |
---|
| 31 | C_OPTIM_FLAGS = -std=c99 -O2 -fstrict-aliasing |
---|
[821] | 32 | C_OS_FLAGS = -DGTODay -DTARGET_OS=LINUX -D_GNU_SOURCE |
---|
[798] | 33 | C_CONFIG_FLAGS = -DCLI |
---|
| 34 | C_INC_FLAGS = -I$(INC_PATH) -Inrc2/include |
---|
| 35 | CFLAGSCPU = |
---|
[823] | 36 | ifeq ($(IGNORE_ASSERT),true) |
---|
| 37 | C_OPTIM_FLAGS := $(C_OPTIM_FLAGS) -DNDEBUG |
---|
| 38 | endif |
---|
[798] | 39 | |
---|
[823] | 40 | LDFLAGS = -Lnrc2 -Wl,--start-group -lnrc2x -lm -lpthread -Wl,--end-group |
---|
[798] | 41 | |
---|
| 42 | endif |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
[823] | 46 | CFLAGSW = -Wredundant-decls -Wdisabled-optimization -Winline -Wpointer-arith -Wsign-compare -Wendif-labels -Wno-unused-function -Wno-unused-variable |
---|
[798] | 47 | |
---|
[772] | 48 | # -- Flags ---------- |
---|
[798] | 49 | CFLAGS = $(C_OPTIM_FLAGS) $(C_OS_FLAGS) $(C_INC_FLAGS) $(C_CONFIG_FLAGS) -g -Wall $(CFLAGSW) $(CFLAGSCPU) |
---|
[772] | 50 | |
---|
| 51 | |
---|
[791] | 52 | APP_NAME = appli.elf |
---|
[772] | 53 | |
---|
| 54 | SRC_FILE = $(wildcard $(SRC_PATH)/*.c) |
---|
[821] | 55 | INC_FILE = $(wildcard $(INC_PATH)/*.h) |
---|
[772] | 56 | |
---|
| 57 | #SRC = $(addprefix $(SRC_PATH)/,$(FILE)) |
---|
| 58 | OBJ_FILE = $(addprefix $(OBJ_PATH)/,$(addsuffix .o, $(basename $(notdir $(SRC_FILE))))) |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | |
---|
[822] | 64 | all: nrclib $(APP_NAME) |
---|
[772] | 65 | |
---|
[822] | 66 | nrclib: |
---|
| 67 | make -C nrc2 |
---|
| 68 | |
---|
[772] | 69 | $(APP_NAME): $(OBJ_FILE) |
---|
| 70 | $(LD) -o $@ $^ $(LDFLAGS) |
---|
| 71 | |
---|
[822] | 72 | #obj/bmpNR.o: src-par/bmpNR.c $(INC_FILE) nrc2/libnrc2x.a ../../build/libs/libuser.a nrc2/include/nrc_os_config.h |
---|
| 73 | # $(CC) -c $(CFLAGS) -o $@ $< |
---|
| 74 | |
---|
[821] | 75 | $(OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(INC_FILE) nrc2/libnrc2x.a ../../build/libs/libuser.a nrc2/include/nrc_os_config.h |
---|
[772] | 76 | $(CC) -c $(CFLAGS) -o $@ $< |
---|
| 77 | |
---|
| 78 | clean: |
---|
| 79 | rm -f $(OBJ_FILE) |
---|
| 80 | rm -f $(APP_NAME) |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | |
---|