blob: e1281d1a46fb6892bb024d4820a2020141f982ae (
plain)
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
|
COMMONFLAGS = -Os -pipe -D_XOPEN_SOURCE=700
CFLAGS = -std=c99
CXXFLAGS = -std=c++11
LIBS = -lm -lrt
SRCS_C = $(sort $(wildcard *.c))
SRCS_CC = $(sort $(wildcard *.cc))
OBJS = $(SRCS_C:.c=.o) $(SRCS_CC:.cc=.o)
BINS = bench
.PHONY: all clean
all: $(BINS)
clean:
rm -f $(BINS)
rm -f $(OBJS)
bench: $(OBJS)
$(CXX) $^ -o $@ $(LIBS)
%.o: %.cc
$(CXX) $(COMMONFLAGS) $(CXXFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(COMMONFLAGS) $(CFLAGS) -c $< -o $@
|