forked from FLAME-HPC/xparser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.tmpl
52 lines (39 loc) · 1.5 KB
/
Makefile.tmpl
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
# Makefile template file for FLAME
#
# FLAME is the FLAME source files
# SOURCE is the user source files
#
# The assumption is that the user only provides C files
# and a model files <file>.xml
#
DEFINES = -DNONE
LIBMBOARD_DIR = libmboard
LIBMBOARD_INC = $(LIBMBOARD_DIR)/include
LIBMBOARD_LIB = $(LIBMBOARD_DIR)/lib
CC = <?if serial?>gcc<?end if?><?if parallel?>mpicc<?end if?>
CFLAGS = -std=c99 -Wall -I$(LIBMBOARD_INC) ${DEFINES}
<?if debug?>CFLAGS += -D_DEBUG_MODE -g<?end if?>
<?if final?>CFLAGS += -O3<?end if?>
LDFLAGS = -L$(LIBMBOARD_LIB)
LIBS = <?if serial?>-lmboard_s<?if debug?>d<?end if?> <?end if?><?if parallel?>-lmboard_p<?if debug?>d<?end if?> <?end if?> -lm
#FLAME source files
FLAME = main.c memory.c xml.c messageboards.c partitioning.c rules.c timing.c
#FLAME auxilary files
AUX = stategraph.dot stategraph_colour.dot process_order_graph.dot Doxyfile latex.tex
# FLAME generated model files
SOURCES = <?foreach functionfiles?> $filepath <?end foreach?>
HEADERS = header.h low_primes.h mboard.h <?foreach xagent?> $name_agent_header.h <?end foreach?>
DEPS = Makefile header.h low_primes.h
OBJECTS = $(SOURCES:.c=.o) $(FLAME:.c=.o)
EXECUTABLE = main
RM = rm -f
all: $(SOURCES) $(FLAME) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
$(OBJECTS): $(DEPS)
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
clean:
$(RM) $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe
vclean:
$(RM) main $(EXECUTABLE) $(EXECUTABLE).exe $(OBJECTS) $(FLAME) $(HEADERS) $(AUX) Makefile