summaryrefslogtreecommitdiff
blob: af142fd574eedc724d5d4b75b598a0302daffc78 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- Makefile.orig	2007-07-13 17:26:30.000000000 +0200
+++ Makefile	2008-01-28 16:36:41.000000000 +0100
@@ -13,8 +13,8 @@
 #OPT	= -pg -g
 
 CC	:= gcc
-CFLAGS	:= $(OPT) -Wall -W -g -ansi -I/usr/X11R6/include
-LDFLAGS := $(OPT) -lX11 -ldockapp
+CFLAGS	:= $(OPT) -Wall -W -g -ansi -I/usr/include
+LDFLAGS += -lX11 -ldockapp
 
 WMSRC	:= wmacpi.c libacpi.c
 HEADERS := libacpi.h wmacpi.h
@@ -22,11 +22,12 @@
 doc_targets := wmacpi.1
 
 ifdef BUILD_CLI
-targets += acpi
-doc_targets += acpi.1
+targets += acpi-batt-status
+doc_targets += acpi-batt-status.1
 endif
 
-PREFIX := /usr/local
+PREFIX := /usr
+MANDIR	:= $(PREFIX)/share/man
 
 all: $(targets)
 
@@ -34,20 +35,20 @@
 WMOBJ := $(patsubst %.c,%.o,$(filter %.c,$(WMSRC)))
 
 # include per-file dependencies
--include $(WMOBJ:.o=.d)
+#-include $(WMOBJ:.o=.d)
 
 wmacpi:	$(WMOBJ)
-	$(CC) $(LDFLAGS) -o $@ $^
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 
 # for the Debian package, we want to make building the command line tools
 # optional. So, we hide all the necessary stuff here . . . 
 ifdef BUILD_CLI
-CLSRC := acpi.c libacpi.c
+CLSRC := acpi-batt-status.c libacpi.c
 CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
--include $(CLOBJ:.o=.d)
+#-include $(CLOBJ:.o=.d)
 
-acpi: $(CLOBJ)
-	$(CC) $(LDFLAGS) -o $@ $^
+acpi-batt-status: $(CLOBJ)
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 endif
 
 # build per-file dependencies - note that -MM may not be supported
@@ -62,10 +63,10 @@
 	rm -f *.d $(targets)
 
 install: $(targets)
-	install -d $(PREFIX)/bin/
-	install -pc $(targets) $(PREFIX)/bin/
-	install -d $(PREFIX)/man/man1/
-	install -pc $(doc_targets) $(PREFIX)/man/man1/
+	install -d $(DESTDIR)$(PREFIX)/bin/
+	install -pc $(targets) $(DESTDIR)$(PREFIX)/bin/
+	install -d $(DESTDIR)$(MANDIR)/man1/
+	install -p -m 0644 $(doc_targets) $(DESTDIR)$(MANDIR)/man1/
 
 tags:
 	etags $(WMSRC) $(CLSRC) $(HEADERS)