| Makefile | 17 ++++++++++------- |
| 1 files changed, 10 insertions(+), 7 deletions(-) |
| |
| diff --git a/Makefile b/Makefile |
| index 2964607..fb4ece8 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -1,10 +1,10 @@ |
| -CC=gcc |
| -CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wswitch -Wshadow -Wcast-align -Wno-unused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls |
| +CC ?=gcc |
| +CFLAGS ?=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wswitch -Wshadow -Wcast-align -Wno-unused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls |
| INSTALL=install |
| -LDFLAGS= |
| +LDFLAGS ?= |
| SOURCES=psinfo.c |
| EXECUTABLE=psinfo |
| -TARGETDIR=/usr/local/bin |
| +TARGETDIR=/usr/bin |
| |
| all: $(EXECUTABLE) |
| |
| @@ -12,7 +12,10 @@ clean: |
| rm -f $(EXECUTABLE) |
| |
| install: $(EXECUTABLE) |
| - $(INSTALL) -m 755 psinfo $(TARGETDIR) |
| + $(INSTALL) -D -m 755 psinfo $(DESTDIR)/$(TARGETDIR)/$(EXECUTABLE) |
| |
| -$(EXECUTABLE): $(SOURCES) |
| - $(CC) $(CFLAGS) -o $@ $(SOURCES) $(LDFLAGS) |
| +$(EXECUTABLE): psinfo.o |
| + $(CC) $(LDFLAGS) -o $@ psinfo.o |
| + |
| +psinfo.o: psinfo.c |
| + $(CC) $(CFLAGS) -c psinfo.c |