summaryrefslogtreecommitdiff
path: root/x11-plugins/wmacpi/files/wmacpi-2.3-makefile.patch
blob: 60629e22ad26bfa5588dae62d17059a71d53e3da (plain)
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
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,8 @@ BUILD_CLI = 1
 # debugging options (don't bother with these)
 #OPT	= -pg -g
 
-CC	:= gcc
-CFLAGS	+= $(OPT) -Wall -W -g -ansi
-LDFLAGS += $(OPT) -lX11 -ldockapp
+CFLAGS	?= -Wall -W -g -ansi
+LIBS += -lX11 -ldockapp
 
 WMSRC	:= wmacpi.c libacpi.c
 HEADERS := libacpi.h wmacpi.h
@@ -26,7 +25,7 @@ targets += wmacpi-cli
 doc_targets += wmacpi-cli.1
 endif
 
-PREFIX := /usr/local
+PREFIX := /usr
 
 all: $(targets)
 
@@ -37,7 +36,7 @@ WMOBJ := $(patsubst %.c,%.o,$(filter %.c,$(WMSRC)))
 -include $(WMOBJ:.o=.d)
 
 wmacpi:	$(WMOBJ)
-	$(CC) -o $@ $^ $(LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 # for the Debian package, we want to make building the command line tools
 # optional. So, we hide all the necessary stuff here . . .
@@ -47,13 +46,13 @@ CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
 -include $(CLOBJ:.o=.d)
 
 wmacpi-cli: $(CLOBJ)
-	$(CC) $(LDFLAGS) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 endif
 
 # build per-file dependencies - note that -MM may not be supported
 # in gcc versions older than 2.95.4, but most likely is.
 %.d: %.c
-	gcc -MM $(CFLAGS) $< > $@
+	$(CC) -MM $(CFLAGS) $< > $@
 
 clean:
 	rm -f TAGS *.o *~ trace *.out *.bb *.bbg