Package: wmgtemp / 1.1-3

update_makefile.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Description: Update manpage.
 In particular,
 - Split LDFLAGS into LDFLAGS and LIBS.
 - Create binary installation directory.
 - Honor CPPFLAGS and DESTDIR variables.
 - Rename CCFLAGS to standard CFLAGS.
Author: Doug Torrance <dtorrance@piedmont.edu>
Last-Update: 2015-01-31

--- a/src/Makefile
+++ b/src/Makefile
@@ -1,9 +1,10 @@
 CC      = gcc
 INSTALL = /usr/bin/install
 LIB     = lib
-LDFLAGS = -L/usr/X11R6/$(LIB) -lXpm -lXext -lX11 -lsensors
+LDFLAGS = -L/usr/X11R6/$(LIB)
+LIBS    = -lXpm -lXext -lX11 -lsensors
 BINARY  = wmgtemp
-CCFLAGS = -Wall -g
+CFLAGS = -Wall -g
 INSTDIR = /usr/local/bin
 
 OFILES  = wmgtemp.o \
@@ -12,16 +13,17 @@
 	./wmgeneral/list.o
 
 %.o:
-	$(CC) $(CCFLAGS) -c $*.c -o $*.o
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c -o $*.o
 
 $(BINARY): $(OFILES)
-	$(CC) $(OFILES) $(LDFLAGS) -o $(BINARY)
+	$(CC) $(OFILES) $(LDFLAGS) -o $(BINARY) $(LIBS)
 
 clean:
 	@ $(RM) $(OFILES) *~ "#"* $(BINARY)
 
 install::
-	$(INSTALL) -m 755 -c $(BINARY) $(INSTDIR)/$(BINARY)
+	$(INSTALL) -d $(DESTDIR)$(INSTDIR)
+	$(INSTALL) -m 755 -c $(BINARY) $(DESTDIR)$(INSTDIR)/$(BINARY)
 
 depend:
 	@ $(CC) -MM *.c > .deps
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@
 
 install:    
 	( cd src && $(MAKE) install INSTDIR=$(INSTDIR) )
-	$(INSTALL) -d $(MANINSTDIR)
-	$(INSTALL) -m 755 -c $(MANPAGE) $(MANINSTDIR)/$(MANPAGE)
+	$(INSTALL) -d $(DESTDIR)$(MANINSTDIR)
+	$(INSTALL) -m 755 -c $(MANPAGE) $(DESTDIR)$(MANINSTDIR)/$(MANPAGE)
 
 clean:
 	( cd src && $(MAKE) clean)