From dbe88638530aacb4cffccfb0b58fa934fc78dd6b Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 4 Jul 2014 10:45:37 -0500 Subject: Add the C++ reference wikisort implementation --- Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a2aada1..a454294 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ -- cgit v1.2.3