# HG changeset patch # User Mike Becker # Date 1356708307 -3600 # Node ID 35120de6ee5372d685bb626c65877c1cddbd819c # Parent fa9bda32de17fc5722386d2b7b897121e8593549 simplified makefile diff -r fa9bda32de17 -r 35120de6ee53 Makefile --- a/Makefile Fri Dec 28 15:44:28 2012 +0100 +++ b/Makefile Fri Dec 28 16:25:07 2012 +0100 @@ -38,39 +38,24 @@ #endif VERSION_PREFIX=1.0. -SRCDIR=src/ -BUILDDIR=build/ -OBJ = $(shell ls ${SRCDIR} | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') -BIN = ${BUILDDIR}cline - -include ${CONF}.mk +SRCDIR=src +BUILDDIR=build +OBJ = arguments.o bfile_heuristics.o cline.o regex_parser.o scanner.o settings.o stream.o string_list.o suffix_fnc.o +BIN = $(BUILDDIR)/cline -.PHONY: setup run-compile teardown +include $(CONF).mk -all: setup run-compile teardown - - -run-compile: - -${MAKE} compile +all: $(BUILDDIR) compile -compile: ${OBJ} - ${LD} -o ${BIN} ${OBJ} ${LDFLAGS} - -setup: ${BUILDDIR} - rm -f ${BUILDDIR}cline.o - mv ${SRCDIR}cline.h ${SRCDIR}cline.src - cat ${SRCDIR}cline.src | sed "s/VERSION.*/VERSION=\"${VERSION_PREFIX}$(shell hg identify -n) ($(shell hg identify -i))\";/g" > ${SRCDIR}cline.h +compile: $(OBJ:%=$(BUILDDIR)/%) + $(LD) -o $(BIN) $^ $(LDFLAGS) -${BUILDDIR}: - mkdir ${BUILDDIR} - -teardown: - rm -f ${SRCDIR}cline.h - mv ${SRCDIR}cline.src ${SRCDIR}cline.h +$(BUILDDIR): + mkdir $(BUILDDIR) -${BUILDDIR}%.o: ${SRCDIR}%.c - ${CC} ${CFLAGS} -c -o ${BUILDDIR}$*.o $< +$(BUILDDIR)/%.o: $(SRCDIR)/%.c + $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -f ${BUILDDIR}*.o + rm -f $(BUILDDIR)/*.o \ No newline at end of file diff -r fa9bda32de17 -r 35120de6ee53 src/cline.c --- a/src/cline.c Fri Dec 28 15:44:28 2012 +0100 +++ b/src/cline.c Fri Dec 28 16:25:07 2012 +0100 @@ -78,7 +78,7 @@ } int exit_with_version(settings_t* settings) { - printf("cline - Revision: %s\n", VERSION); + printf("cline - Version: %s\n", VERSION); destroy_settings_t(settings); return 0; } diff -r fa9bda32de17 -r 35120de6ee53 src/cline.h --- a/src/cline.h Fri Dec 28 15:44:28 2012 +0100 +++ b/src/cline.h Fri Dec 28 16:25:07 2012 +0100 @@ -32,7 +32,7 @@ #ifndef CLINE_H_ #define CLINE_H_ -const char* VERSION=""; /* will be replaced by makefile */ +const char* VERSION="1.0.35"; #include "stdinc.h" #include "settings.h"