diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -1,8 +1,11 @@ -CFLAGS = -Os -pipe -std=c99 -D_XOPEN_SOURCE=500 -LDFLAGS = -lm +COMMONFLAGS = -Os -pipe -D_XOPEN_SOURCE=500 +CFLAGS = -std=c99 +CXXFLAGS = -std=c++11 +LIBS = -lm -SRCS = $(sort $(wildcard *.c)) -OBJS = $(SRCS:.c=.o) +SRCS_C = $(sort $(wildcard *.c)) +SRCS_CC = $(sort $(wildcard *.cc)) +OBJS = $(SRCS_C:.c=.o) $(SRCS_CC:.cc=.o) BINS = bench .PHONY: all clean @@ -14,7 +17,10 @@ clean: rm -f $(OBJS) bench: $(OBJS) - $(CC) $(LDFLAGS) $^ -o $@ + $(CXX) $^ -o $@ $(LIBS) + +%.o: %.cc + $(CXX) $(COMMONFLAGS) $(CXXFLAGS) -c $< -o $@ %.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(COMMONFLAGS) $(CFLAGS) -c $< -o $@ |