-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 702 Bytes
/
Makefile
File metadata and controls
34 lines (27 loc) · 702 Bytes
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
SOURCES := $(wildcard *.cpp)
TARGETS := $(SOURCES:.cpp=)
COMMON := -O2 -Wall -Wformat=2 -march=native
CFLAGS := $(CFLAGS) $(COMMON)
CXXFLAGS := $(CXXFLAGS) $(COMMON)
CC := gcc
CXX := g++
LD := $(CXX) # probably want $(CXX) for cpp source
LDFLAGS := $(LDFLAGS) # -L/path/to/libs/
LDADD := # -lrt
INCLUDE := # -I../path/to/headers/
DEFS := # -DLINUX
.PHONY : all
all : $(TARGETS)
# {{{ for debugging
DBGFLAGS := -g
debug : CFLAGS += $(DBGFLAGS)
debug : CXXFLAGS += $(DBGFLAGS)
debug : all
.PHONY : debug
# }}}
$(TARGETS) : % : %.cpp
$(LD) $(LDFLAGS) -o $@ $^ $(LDADD)
.PHONY : clean
clean :
rm -f $(TARGETS)
# vim:ft=make:foldmethod=marker:foldmarker={{{,}}}