blob: 8cf35ada70f1699191baa30598458224484e710c (
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=500
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 $@
|