diff options
author | Nick White <hg@njw.me.uk> | 2011-07-16 23:48:08 +0100 |
---|---|---|
committer | Nick White <hg@njw.me.uk> | 2011-07-16 23:48:08 +0100 |
commit | 721770691c964dbd630716add95a362a0cecba4d (patch) | |
tree | c5008e66211b617b9c77e82a4af005ca8e5501b8 /Makefile | |
parent | c2892e23ef3aa063812714323b5e8f9ebe0fc318 (diff) |
Improve build system
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -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 |