summaryrefslogtreecommitdiff
blob: 6636484f876edc6942cdf6f96da3cfa452c8471c (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
Respect LDFLAGS, CFLAGS, CC  #334715
Fix install paths

--- Makefile
+++ Makefile
@@ -1,33 +1,29 @@
 # Makefile for spectromatic
 
-CFLAGS = -O2 -Wall 
-LIBS = -lgsl -lgslcblas -lpng -lm
+LIBS = -lpng `pkg-config --libs gsl`
 DESTDIR =
 TOPLEVEL_HOME = /usr
 
-CC = gcc -I.
-
 SRC = spectromatic.c wave.c
 
 OBJ = $(SRC:.c=.o)
 
 TARGET = spectromatic
 
-install:	all
-	mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/bin
-	mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/man/man1
-	install -o root -g root -m 0755 spectromatic $(DESTDIR)$(TOPLEVEL_HOME)/bin
-	install -o root -g root -m 0644 man/spectromatic.1 $(DESTDIR)$(TOPLEVEL_HOME)/man/man1
-
 all:	$(OBJ)
-	$(CC) -o $(TARGET) $(OBJ) $(LIBS)
-	strip $(TARGET)
+	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJ) $(LIBS)
+
+install: $(TARGET)
+	mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/bin
+	mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/share/man/man1
+	install -m 0755 spectromatic $(DESTDIR)$(TOPLEVEL_HOME)/bin
+	install -m 0644 man/spectromatic.1 $(DESTDIR)$(TOPLEVEL_HOME)/share/man/man1
 
 clean:
 	$(RM) $(TARGET) $(OBJ)
 
 .c.o:
-	$(CC) $(CFLAGS) -c $< 
+	$(CC) $(CFLAGS) -I. -c $< 
 
 .o:
 	$(CC) $< $(LIBS) -o $@