summaryrefslogtreecommitdiff
blob: 749d6025d46c8b48aeb88a58b671e087fefd770c (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
72
73
74
75
76
77
78
79
80
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-prefix = /usr/local
+prefix = /usr
 libdir = $(prefix)/lib/nut
 bindir = $(prefix)/bin
 mandir = $(prefix)/man/man1
@@ -8,15 +8,6 @@
 EXECUTABLE := nut
 LIBS := -lm
 
-FLTK_CONFIG := $(shell fltk-config --version 2>/dev/null)
-ifeq ($(FLTK_CONFIG),)
-HAVE_FLTK = 0
-FLTK_NUT =
-else
-HAVE_FLTK = 1
-FLTK_NUT = fltk/Nut
-endif
-
 OS := $(shell uname -s)
 ifeq ($(OS),HP-UX)
 CC = cc
@@ -24,7 +15,7 @@
 CC = gcc
 endif
 
-CFLAGS := -O -DNUTDIR=$(NUTDIR) -DFOODDIR=$(FOODDIR)
+CFLAGS += -DNUTDIR=$(NUTDIR) -DFOODDIR=$(FOODDIR)
 ifeq ($(CC),gcc)
 CFLAGS += -Wall -fno-inline -ansi
 endif
@@ -34,15 +25,10 @@
 SOURCE := $(wildcard *.c)
 OBJS := $(patsubst %.c,%.o,$(SOURCE))
 
-all: nut $(FLTK_NUT)
+all: nut
 
 nut:	$(OBJS)
-	$(CC) -O -o $(EXECUTABLE) $(OBJS) $(LIBS)
-
-ifeq ($(HAVE_FLTK),1)
-$(FLTK_NUT):
-	-cd fltk; $(MAKE)
-endif
+	$(CC) $(LDFLAGS) -o $(EXECUTABLE) $(OBJS) $(LIBS)
 
 deps:
 	makedepend -Y. *.c >/dev/null 2>&1
--- a/fltk/Makefile
+++ b/fltk/Makefile
@@ -5,7 +5,7 @@
 NUTDIR := \".nutdb\"
 FOODDIR := \"$(libdir)\"
 EXECUTABLE := Nut
-LIBS := `fltk-config --ldstaticflags` -lXpm
+LIBS := `fltk-config --ldflags` -lXpm
 
 OS := $(shell uname -s)
 ifeq ($(OS),HP-UX)
@@ -17,7 +17,7 @@
 CXX = g++
 endif
 
-CFLAGS := -I.. `fltk-config --optim --cflags` -O -DNUTDIR=$(NUTDIR) -DFOODDIR=$(FOODDIR)
+CFLAGS += -I.. `fltk-config --optim --cflags` -DNUTDIR=$(NUTDIR) -DFOODDIR=$(FOODDIR)
 
 ifeq ($(CXX),g++)
 CFLAGS := -I.. `fltk-config --optim --cflags` -DNUTDIR=$(NUTDIR) -DFOODDIR=$(FOODDIR) -Wall -fno-inline -ansi
@@ -29,7 +29,7 @@
 OBJS := ../anameal.o ../db.o ../food.o ../meal.o ../options.o ../prtmenu.o ../recmeal.o ../util.o $(patsubst %.cc,%.o,$(SOURCE))
 
 nut:	$(OBJS)
-	$(CXX) -O -o $(EXECUTABLE) $(OBJS) $(LIBS)
+	$(CXX) $(LDFLAGS) -o $(EXECUTABLE) $(OBJS) $(LIBS)
 
 deps:
 	makedepend -Y.. ../anameal.c ../db.c ../food.c ../meal.c ../options.c ../prtmenu.c ../recmeal.c ../util.c *.cc >/dev/null 2>&1