summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNick White <hg@njw.me.uk>2011-07-16 23:48:08 +0100
committerNick White <hg@njw.me.uk>2011-07-16 23:48:08 +0100
commit721770691c964dbd630716add95a362a0cecba4d (patch)
treec5008e66211b617b9c77e82a4af005ca8e5501b8 /Makefile
parentc2892e23ef3aa063812714323b5e8f9ebe0fc318 (diff)
Improve build system
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 17 insertions, 6 deletions
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