| 1 |
PROGRAM = main |
| 2 |
|
| 3 |
SRCS = {{source_files}} |
| 4 |
H_SRCS = {{header_files}} |
| 5 |
OBJS = ${SRCS:.cpp=.o} |
| 6 |
OBJS := ${OBJS:.c=.o} |
| 7 |
OPTIMISATIONS = {{ compiler_flags }} |
| 8 |
CXXFLAGS = -c -Wno-write-strings $(OPTIMISATIONS) -I. {{ openmp_pragma('compilation') }} {{ compiler_debug_flags }} |
| 9 |
LFLAGS = {{ openmp_pragma('compilation') }} {{ linker_flags }} {{ linker_debug_flags }} |
| 10 |
DEPS = make.deps |
| 11 |
|
| 12 |
all: $(PROGRAM) |
| 13 |
|
| 14 |
.PHONY: all clean |
| 15 |
|
| 16 |
$(PROGRAM): $(OBJS) $(DEPS) makefile |
| 17 |
$(CXX) $(OBJS) -o $(PROGRAM) $(LFLAGS) |
| 18 |
|
| 19 |
clean: |
| 20 |
{{ rm_cmd }} |
| 21 |
|
| 22 |
make.deps: $(SRCS) $(H_SRCS) |
| 23 |
$(CXX) $(CXXFLAGS) -MM $(SRCS) > make.deps |
| 24 |
|
| 25 |
ifneq ($(wildcard $(DEPS)), ) |
| 26 |
include $(DEPS) |
| 27 |
endif |
| 28 |
|
| 29 |
%.o : %.cpp makefile |
| 30 |
$(CXX) $(CXXFLAGS) $< -o $@ |