diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-07 23:31:53 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-07 23:31:53 +0200 |
commit | 12ba32472cd44f18dc35e71fac111c932cbf1d4d (patch) | |
tree | 2632b6e857c11e77b7e3405f21e2bee08493a4b2 /Makefile | |
parent | 774eeafaa97ea3057709ca674b8838625c286359 (diff) | |
download | ministat-10.0.tar.gz ministat-10.0.tar.xz ministat-10.0.zip |
Makefile: use DESTDIR, fixes. v10.0
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile index 4957f82..24bcd7d 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,9 @@ PKGS = CFLAGS += -g -Wall -Werror CPPFLAGS+= -I. -D_GNU_SOURCE -LDFLAGS += -lm +LIBS = -lm +DESTDIR = PREFIX ?= /usr # No user serviceable parts below this line. @@ -18,15 +19,16 @@ PREFIX ?= /usr all: $(BIN) $(BIN): $(OBJS) - $(CC) $(OBJS) ${LDFLAGS} -o ${BIN} + $(CC) $(OBJS) ${LDFLAGS} -o ${BIN} $(LIBS) $(OBJS): %.o: %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< install: - install -d $(PREFIX)/bin - install -m 0755 $(BIN) $(PREFIX)/bin/$(BIN) - install -m 0755 $(MAN) $(PREFIX)/share/man/man1/$(MAN) + install -d $(DESTDIR)$(PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/share/man/man1 + install -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin/$(BIN) + install -m 0644 $(MAN) $(DESTDIR)$(PREFIX)/share/man/man1/$(MAN) clean: -rm -rf $(BIN) *.o *.core |