blob: b6d92392d1794a0932d98f06191b3b6e2b8c2cac (
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
|
Fix build system to honour user variables.
--- a/Makefile
+++ b/Makefile
@@ -19,32 +19,31 @@
##############################################################################
SHELL = /bin/sh
-CC = gcc
+CC ?= gcc
-CFLAGS += -pedantic -Wall -O3
-LFLAGS = -lm $(LDFLAGS)
+LIBS = -lm
TARGET = prodigal
SOURCES = $(shell echo *.c)
HEADERS = $(shell echo *.h)
OBJECTS = $(SOURCES:.c=.o)
-INSTALLDIR = /usr/local/bin
+BINDIR = $(EPREFIX)/usr/bin
all: $(TARGET)
$(TARGET): $(OBJECTS)
- $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
%.o: %.c $(HEADERS)
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) -Wall -pedantic $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
install: $(TARGET)
- install -d -m 0755 $(INSTALLDIR)
- install -m 0755 $(TARGET) $(INSTALLDIR)
+ install -d -m 0755 $(DESTDIR)$(BINDIR)
+ install -m 0755 $(TARGET) $(DESTDIR)$(BINDIR)
uninstall:
- -rm $(INSTALLDIR)/$(TARGET)
+ -rm $(DESTDIR)$(BINDIR)/$(TARGET)
clean:
-rm -f $(OBJECTS)
|