From 628bab5c6a24346c22ab039eb2df19ad461ba726 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 1 Jun 2011 11:44:49 +0300 Subject: Add a Makefile to compile and link the example --- Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f1aeb3 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +ifdef OS +ifeq (,$(findstring windows,${OS})) +ifneq (,$(findstring Windows,${OS})) +WINDOWS = 1 +endif +else +WINDOWS = 1 +endif +endif + +CXX = g++ +LD = g++ + +ifdef WINDOWS +RM = del +else +RM = rm -f +endif + +CXXFLAGS = -Wall -Wextra -g -O0 + +SRCS = example.cpp sxml.cpp +OBJS = $(addsuffix .o,$(basename ${SRCS})) + +OUTPUT = example + +.PHONY: clean + +all: ${OUTPUT} + +clean: + ${RM} ${OBJS} ${OUTPUT} + +${OUTPUT}: ${OBJS} + ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS} + +%.o: %.cpp + ${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@ -- cgit v1.2.3