-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (35 loc) · 1.82 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Fast will break some prgrams, but without it some will fail to compile.
LDF ?= ${EPIPHANY_HOME}/bsps/current/fast.ldf
#LDF ?= /opt/adapteva/esdk/bsps/current/internal.ldf
# Optimizations will break some programs
#CFLAGS = -DROWS=63 -DCOLS=64 -DFIRST_CORE=0x40 -g -O0 -Wall -Wno-unused -Werror -ffast-math -falign-functions=16
#CFLAGS = -DROWS=4 -DCOLS=4 -DFIRST_CORE=0x808 -g -O0 -Wall -Wno-unused -Werror -ffast-math -falign-functions=16
CFLAGS += -g -O0 -Wall -Wno-unused -Werror -ffast-math -falign-functions=8
CC = e-gcc
LDFLAGS = -T$(LDF)
LDLIBS = -le-lib
SRCS = $(shell find . -name "*.c")
BINS = $(SRCS:.c=)
BINS += zigzag/zigzag16 zigzag/zigzag64 zigzag/zigzag120 zigzag/zigzag768 zigzag/zigzag4095
BINS += e-server/branch_by_coreid e-server/zigzag16
ZIGZAG_16_CFLAGS = -DROWS=4 -DCOLS=4 -DFIRST_CORE=0x808
ZIGZAG_64_CFLAGS = -DROWS=8 -DCOLS=8 -DFIRST_CORE=0x808
ZIGZAG_120_CFLAGS = -DROWS=15 -DCOLS=8 -DFIRST_CORE=0x808
ZIGZAG_768_CFLAGS = -DROWS=32 -DCOLS=24 -DFIRST_CORE=0x808
ZIGZAG_4095_CFLAGS = -DROWS=64 -DCOLS=64 -DFIRST_CORE=0
ZIGZAG_4095_LDFLAGS = -T./zigzag/extraminternal.ldf
all: $(BINS)
zigzag/zigzag16: zigzag/zigzag.c
$(CC) -o $@ $(ZIGZAG_16_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(LDFLAGS)
zigzag/zigzag64: zigzag/zigzag.c
$(CC) -o $@ $(ZIGZAG_64_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(LDFLAGS)
zigzag/zigzag120: zigzag/zigzag.c
$(CC) -o $@ $(ZIGZAG_120_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(LDFLAGS)
zigzag/zigzag768: zigzag/zigzag.c
$(CC) -o $@ $(ZIGZAG_768_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(LDFLAGS)
zigzag/zigzag4095: zigzag/zigzag.c
$(CC) -o $@ $(ZIGZAG_4095_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(ZIGZAG_4095_LDFLAGS)
e-server/zigzag16: e-server/zigzag.c
$(CC) -o $@ $(ZIGZAG_16_CFLAGS) $(CFLAGS) $< $(LDLIBS) -Wl,$(LDFLAGS)
clean:
rm -f $(BINS) zigzag/log/log.*