summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2014-07-04 10:45:37 -0500
committerBobby Bingham <koorogi@koorogi.info>2014-07-04 10:45:37 -0500
commitdbe88638530aacb4cffccfb0b58fa934fc78dd6b (patch)
tree1379ec704e9f2b6ce3e2c4b92da367103e662b35 /Makefile
parent4178350f795d568cdba861b6200bb9a33944e1c9 (diff)
Add the C++ reference wikisort implementation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 12 insertions, 6 deletions
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 $@