From 721770691c964dbd630716add95a362a0cecba4d Mon Sep 17 00:00:00 2001 From: Nick White Date: Sat, 16 Jul 2011 23:48:08 +0100 Subject: Improve build system --- Makefile | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d9ca4fb..ff728e6 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,30 @@ +# See COPYING file for copyright, license and warranty details. + +include config.mk + SRC = getgbook.c OBJ = $(SRC:.c=.o) +BIN = $(SRC:.c=) -all: getgbook +all: $(BIN) + +$(OBJ): util.c .c.o: @echo CC $< - @$(CC) -c -g -Wall -Werror $(CFLAGS) $< - -$(OBJ): util.c + @$(CC) -c $(CFLAGS) $< getgbook: $(OBJ) @echo LD $@ @$(CC) -o $@ $(OBJ) $(LDFLAGS) +install: all + cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin + +uninstall: + cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) + clean: - rm -f -- getgbook $(OBJ) + rm -f -- $(BIN) $(OBJ) -.PHONY: all clean +.PHONY: all clean install uninstall -- cgit v1.2.3