diff options
author | Nick White <hg@njw.me.uk> | 2011-07-21 22:53:00 +0100 |
---|---|---|
committer | Nick White <hg@njw.me.uk> | 2011-07-21 22:53:00 +0100 |
commit | 6975914fcab0b795aed0a19ed4c277e9f3f628a5 (patch) | |
tree | 84f59ac3acbe7af8031e2aad9bb54f8bd4bf7834 /Makefile | |
parent | 2792ba2ddfbf7ece7b960faf1ec28c022e9c566e (diff) |
Add makefile and util.h to finish previous commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1,22 +1,29 @@ # See COPYING file for copyright, license and warranty details. - include config.mk SRC = getgbook.c -OBJ = $(SRC:.c=.o) +LIB = util.o + BIN = $(SRC:.c=) +OBJ = $(SRC:.c=.o) $(LIB) all: $(BIN) -$(OBJ): util.c +$(OBJ): util.h config.mk +$(BIN): util.a + +.o: + @echo LD $@ + @$(LD) -o $@ $< util.a $(LDFLAGS) .c.o: @echo CC $< @$(CC) -c $(CFLAGS) $< -getgbook: $(OBJ) - @echo LD $@ - @$(CC) -o $@ $(OBJ) $(LDFLAGS) +util.a: $(LIB) + @echo AR $@ + @$(AR) -r -c $@ $(LIB) + @ranlib $@ install: all cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin @@ -25,6 +32,6 @@ uninstall: cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) clean: - rm -f -- $(BIN) $(OBJ) + rm -f -- $(BIN) $(OBJ) util.a .PHONY: all clean install uninstall |