summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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