From d29ed3e8ddfbb0367dd67aa0f3b864b41357d1eb Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 23 Jul 2015 14:14:01 -0600 Subject: Actually added a makefile with dep support. Also updated the gitignore to ignore the dep files. --- .gitignore | 1 + Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index fbc5251..5855c26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .*.swp *.o +*.d *.exe /clic /.build_cache diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b6ff92e --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +SRC := $(wildcard src/*.cpp) +OBJECTS := $(patsubst %.cpp,%.o,${SRC}) +DEPS := $(patsubst %.cpp,%.d,${SRC}) + +.PHONY: default all clean + +default: clic.exe + +all: clic.exe + +clean: + -rm clic.exe ${OBJECTS} ${DEPS} + +clic.exe: ${OBJECTS} + g++ -ggdb -o clic.exe ${OBJECTS} -L../libbu++ -lbu++ ${LDCONFIG} + +${OBJECTS}: %.o: %.cpp + g++ -ggdb -W -Wall -I../libbu++ $< -c -o $@ + +${DEPS}: %.d: %.cpp + g++ -M -I../libbu++ $< > $@ + sed -i -e 's,^\([^ ]*\)\( *: *\),src/\1 $@: ,' $@ + +-include ${DEPS} + -- cgit v1.2.3