jobextra/procstatd/procstatd-Makefile.patch

75 lines
1.8 KiB
Diff

diff --git a/Makefile b/Makefile
index c2a2599..bed7042 100644
--- a/Makefile
+++ b/Makefile
@@ -23,9 +23,7 @@
# General definitions
##########################
CC=gcc
-CFLAGS=-O3
-COMPILE=$(CC) -c $(CFLAGS)
-LINK=$(CC)
+CFLAGS?=-O3
##########################
# Tree point to install
@@ -33,7 +31,7 @@ LINK=$(CC)
##########################
# INSTDIR=/usr/local
# INSTDIR=/usr
-INSTDIR=$(HOME)
+DESTDIR=
##########################
# Program name(s)
@@ -41,7 +39,7 @@ INSTDIR=$(HOME)
PROGRAM=procstatd
WATCHMAN=watchman
-
+all : $(PROGRAM)
##########################
# Source and object list
##########################
@@ -51,20 +49,19 @@ SRC=procstatd.c parsecl.c parse.c statlist.c senddata.c procutils.c \
time.c users.c identity.c \
ipcstuff.c filestuff.c jobslist.c quiklist.c
OBJ=$(SRC:.c=.o)
-
##########################
# Rule to make program
##########################
$(PROGRAM) : $(OBJ)
- $(LINK) $(OBJ) -o $@
+ $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
##########################
# Rule to make .o objects
# Note sole .h dependency
##########################
-%.o : %.c procstatd.h
- $(COMPILE) $< -o $@
-
+#%.o : %.c procstatd.h
+# $(COMPILE) $< -o $@
+$(SRC) : procstatd.h
##########################
# Rule to clean up
##########################
@@ -75,11 +72,8 @@ clean :
# Rule to install.
##########################
install :
- (strip $(PROGRAM);\
- install -d $(INSTDIR)/sbin; \
- install -d $(INSTDIR)/man/man8; \
- install -m 755 $(PROGRAM) $(INSTDIR)/sbin; \
- install -m 644 $(PROGRAM).8 $(INSTDIR)/man/man8; \
- cd watchman; \
- make install)
+ install -d $(DESTDIR)/bin; \
+ install -d $(DESTDIR)/share/man/man8; \
+ install -m 755 $(PROGRAM) $(DESTDIR)/bin; \
+ install -m 644 $(PROGRAM).8 $(DESTDIR)/share/man/man8