forked from OdnetninI/Splash-4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.config
54 lines (38 loc) · 1.15 KB
/
Makefile.config
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
46
47
48
49
50
51
52
53
CC := gcc-9
CFLAGS := -O2 -pthread -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112 -std=c11 -g -fno-strict-aliasing
LDFLAGS := -lm
BASEDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
MACROS := $(BASEDIR)/pthread.m4
M4 := m4
M4FLAGS := -Ulen -Uindex -P
M4FLAGS += -D ATOMIC_BARRIERS
CFLAGS += -D ATOMIC_BARRIERS
CFLAGS += -D SWARM_RUNTIME
ifndef BASEDIR
$(error Please define the BASEDIR variable)
endif
x = *
$(TARGET): $(OBJS) $(EXTRADEPS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
bindCores: M4FLAGS += -D BIND_CORES
bindCores: CFLAGS += -D BIND_CORES
bindCores: CFLAGS += -D_GNU_SOURCE
bindCores: TARGET := $(TARGET)-bindedCores
bindCores: $(TARGET)
bindThreads: M4FLAGS += -D BIND_THREADS
bindThreads: CFLAGS += -D BIND_THREADS
bindThreads: CFLAGS += -D_GNU_SOURCE
bindThreads: TARGET := $(TARGET)-bindedThreads
bindThreads: $(TARGET)
debug: $(OBJS) $(EXTRADEPS)
$(CC) $(CFLAGS) -g -o $(TARGET) $(OBJS) $(LDFLAGS)
clean:
rm -rf *.c *.h *.o $(TARGET)*
semiclean:
rm -rf *.c *.h *.o
%.h: %.h.in
$(M4) $(M4FLAGS) $(MACROS) $< > $@
%.c: %.c.in
$(M4) $(M4FLAGS) $(MACROS) $< > $@
%.o: %.c $(EXTRADEPS)
$(CC) -c $(CFLAGS) $<