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
72
73
|
From: Julian Ospald <hasufell@gentoo.org>
Date: Wed Dec 26 19:46:44 UTC 2012
Subject: build system
respect flags, add LDFLAGS to linker line
fix install rules
--- Makefile
+++ Makefile
@@ -15,13 +15,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-CC = gcc
+CC ?= gcc
RPM_BUILD_ROOT=
# PREFIX is usually either /usr or /usr/local
PREFIX=/usr/local
+BINDIR=$(PREFIX)/sbin
+ETCDIR=/etc
TARGET=linux
@@ -32,8 +34,8 @@
VERSION=1.1
#CFLAGS= -I../include/ -O3 -Wimplicit
-CFLAGS= -I../include/ -g -Wimplicit -DPREFIX=\"$(PREFIX)\" -DTARGET_$(TARGET) -DVERSION=\"$(VERSION)\"
-LINK = gcc
+CFLAGS += -Wimplicit
+CPPFLAGS = -I../include/ -DPREFIX=\"$(PREFIX)\" -DTARGET_$(TARGET) -DVERSION=\"$(VERSION)\"
AG = /home3/sdh4/anagram/ag_unix_dev/ag
@@ -55,20 +57,15 @@
(cd .. ; tar cvzf verynice-$(VERSION).tar.gz verynice/ )
install:
- $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/sbin
- $(INSTALL) verynice $(RPM_BUILD_ROOT)$(PREFIX)/sbin
- if [ $(PREFIX) = "/usr" ]; then \
- mv -f $(RPM_BUILD_ROOT)/etc/verynice.conf $(RPM_BUILD_ROOT)/etc/verynice.conf~ ; \
- $(INSTALL) verynice.conf $(RPM_BUILD_ROOT)/etc ; \
- else \
- $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/etc ; \
- mv -f $(RPM_BUILD_ROOT)$(PREFIX)/etc/verynice.conf $(RPM_BUILD_ROOT)$(PREFIX)/etc/verynice.conf~ ; \
- $(INSTALL) -m 644 verynice.conf $(RPM_BUILD_ROOT)$(PREFIX)/etc ; \
- fi
+ $(INSTALL) -d $(RPM_BUILD_ROOT)$(BINDIR)
+ $(INSTALL) verynice $(RPM_BUILD_ROOT)$(BINDIR)
+ $(INSTALL) -d $(RPM_BUILD_ROOT)$(ETCDIR)
+ $(INSTALL) -m 644 verynice.conf $(RPM_BUILD_ROOT)$(ETCDIR)
$(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share
$(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc
$(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)
- $(INSTALL) -m 644 verynice.html $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)
+ $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)/html
+ $(INSTALL) -m 644 verynice.html $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)/html
$(INSTALL) -m 644 README $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)
$(INSTALL) -m 644 README.SYN $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)
$(INSTALL) -m 644 COPYING $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)
@@ -95,7 +92,7 @@
$(AG) $*
verynice: verynice.o config.o linklist.o stringstack.o
- $(LINK) -g -o $@ $^ -lm
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lm
|