summaryrefslogtreecommitdiff
path: root/editors/manedit/files/patch-Makefile
blob: 01f9538a6ea97568e9cdda0bcf06ade7b77b6bef (plain) (blame)
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
$FreeBSD$

--- Makefile.orig	Fri Feb  9 02:18:25 2001
+++ Makefile	Fri Feb  9 15:41:52 2001
@@ -18,7 +18,7 @@
 #   You may modify any value as needed. Change only the ones you are
 #   absolutly sure that requires modification.
 #
-PREFIX = /usr
+PREFIX ?= /usr
 
 
 # ########################################################################
@@ -49,7 +49,9 @@
 #				to debug the program.
 #
 #CFLAGS = `gtk-config --cflags` -g -efence -Wall
-CFLAGS = `gtk-config --cflags` -O2 -Wall
+GTK_CFLAGS !=  $(GTK_CONFIG) --cflags
+CFLAGS += $(GTK_CFLAGS) -Wall -DPREFIX=\"$(PREFIX)\" \
+	  -DLOCALBASE=\"$(LOCALBASE)\" -DX11BASE=\"$(X11BASE)\"
 
 CPPFLAGS = -D__cplusplus -Dc_plusplus
 
@@ -65,7 +67,7 @@
 #   to the LIB line depending on what you have set in the CFLAGS line
 #   farther above.
 #
-LIB = `gtk-config --libs`
+LIB != $(GTK_CONFIG) --libs
 
 # Library Directories:
 #
@@ -95,9 +97,10 @@
 #
 include Makefile.srclist
 
-CC  = gcc
-CPP = g++
+CC  ?= gcc
+CPP = $(CXX)
 BIN = manedit
+SED ?= sed
 OBJ_C = $(SRC_C:.c=.o)
 OBJ_CPP = $(SRC_CPP:.cpp=.o)
 .c.o:
@@ -112,7 +115,7 @@
 $(BIN): $(OBJ_C) $(OBJ_CPP)
 	$(CC) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIB) $(LIB_DIR)
 
-all: $(BIN)
+all: $(BIN) $(BIN).1.out
 
 
 # ########################################################################
@@ -129,5 +132,7 @@
 clean:
 	rm -f a.out core *.o
 
+$(BIN).1.out: $(BIN).1
+	$(SED) 's|%%PREFIX%%|$(PREFIX)|g' $(BIN).1 > $(BIN).1.out
 
 # ########################################################################