summaryrefslogtreecommitdiff
blob: 2fd48e9ff85a61161e7fdf5bdfdfd7a9f65386b4 (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
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,9 +9,9 @@
 eprefix=@exec_prefix@
 #MORE_WARNINGS=-Weffc++
 WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS)
-CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS)
-CXX=@CXX@ $(CFLAGS)
-LINK=@CXX@
+CXXFLAGS += @debug@ -DNDEBUG $(WFLAGS)
+CXX=@CXX@ $(CXXFLAGS)
+LINK=@CXX@ $(LDFLAGS)
 THREAD_LFLAGS=@thread_ldflags@
 
 INSTALL=@INSTALL@
@@ -43,7 +43,7 @@
 	$(LINK) -o getc_putc $(GETCOBJS) $(THREAD_LFLAGS)
 
 getc_putc_helper: $(GETCHOBJS)
-	$(CXX) -o getc_putc_helper $(GETCHOBJS)
+	$(CXX) $(LDFLAGS) -o getc_putc_helper $(GETCHOBJS)
 
 bon_csv2html: bon_csv2html.o
 	$(LINK) bon_csv2html.o -o bon_csv2html
@@ -52,15 +52,15 @@
 	$(LINK) generate_randfile.o -o generate_randfile
 
 install-bin: $(EXE) $(EXES)
-	mkdir -p $(eprefix)/bin $(eprefix)/sbin
-	@INSTALL_PROGRAM@ @stripping@ $(EXES) $(eprefix)/sbin
-	@INSTALL_PROGRAM@ @stripping@ $(EXE) $(eprefix)/bin
-	@INSTALL_SCRIPT@ $(SCRIPTS) $(eprefix)/bin
+	mkdir -p $(DESTDIR)/$(eprefix)/bin $(DESTDIR)/$(eprefix)/sbin
+	@INSTALL_PROGRAM@ @stripping@ $(EXES) $(DESTDIR)/$(eprefix)/sbin
+	@INSTALL_PROGRAM@ @stripping@ $(EXE) $(DESTDIR)/$(eprefix)/bin
+	@INSTALL_SCRIPT@ $(SCRIPTS) $(DESTDIR)/$(eprefix)/bin
 
 install: install-bin
-	mkdir -p @mandir@/man1 @mandir@/man8
-	@INSTALL_DATA@ $(MAN1) @mandir@/man1
-	@INSTALL_DATA@ $(MAN8) @mandir@/man8
+	mkdir -p $(DESTDIR)/@mandir@/man1 $(DESTDIR)/@mandir@/man8
+	@INSTALL_DATA@ $(MAN1) $(DESTDIR)/@mandir@/man1
+	@INSTALL_DATA@ $(MAN8) $(DESTDIR)/@mandir@/man8
 
 %.o: %.cpp
 	$(CXX) -c $<