Makefile (659B)
1 VERSION = 0.1 2 PREFIX = /usr/local 3 SRC = pexec.c 4 OBJ = pexec.o 5 BIN = pexec 6 DISTFILES = $(SRC) Makefile arg.h 7 8 all: $(BIN) 9 10 pexec.o: arg.h 11 12 clean: 13 rm -f $(OBJ) $(BIN) $(BIN)-$(VERSION).tar.gz 14 15 install: all 16 mkdir -p $(DESTDIR)$(PREFIX)/bin 17 cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin 18 19 uninstall: 20 rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) 21 22 dist: 23 mkdir -p $(BIN)-$(VERSION) 24 cp $(DISTFILES) $(BIN)-$(VERSION) 25 tar -cf $(BIN)-$(VERSION).tar $(BIN)-$(VERSION) 26 gzip $(BIN)-$(VERSION).tar 27 rm -rf $(BIN)-$(VERSION) 28 29 .PHONY: all clean install uninstall dist 30 31 .SUFFIXES: .c .o 32 33 .c.o: 34 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< 35 36 $(BIN): $(OBJ) 37 $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)