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
|
--- GNUmakefile.orig Wed Jan 30 14:07:54 2002
+++ GNUmakefile Sat Jun 8 13:43:27 2002
@@ -8,11 +8,7 @@
# Where to install.
#
-ifeq ($(USER),root)
- INSTALL_DIR=/usr/local/bin
-else
- INSTALL_DIR=$(HOME)/bin
-endif
+ INSTALL_DIR=${PREFIX}/bin
C_SRCS_ = main.c \
widgets.c \
@@ -71,7 +67,7 @@
else
ifndef DEBUG
-C_OPTIMIZE = -O2 -finline-functions
+C_OPTIMIZE = ${CFLAGS}
else
C_OPTIMIZE = -O
endif
@@ -137,10 +133,10 @@
# ----- editing the rest should usually be unnecessary ------------------------
-CC = gcc -c
-CC_FLAGS = -I$(INC_DIR) $(PROF_OPTS) $(C_DEBUG) $(C_OPTIMIZE) $(C_OPTS) $(C_WARNINGS) -pipe `$(GTK_CONFIG) --cflags` `gnome-config --cflags gnomeui`
-LD = gcc
-LD_FLAGS = $(PROF_OPTS) -pipe `$(GTK_CONFIG) --libs` `gnome-config --libs gnomeui`
+#CC = gcc -c
+CC_FLAGS = -I$(INC_DIR) $(PROF_OPTS) $(C_DEBUG) $(C_OPTIMIZE) $(C_OPTS) $(C_WARNINGS) `gnome-config --cflags gnomeui`
+LD = $(CC)
+LD_FLAGS = $(PROF_OPTS) -pipe `gnome-config --libs gnomeui`
C_SRCS = $(addprefix src/,$(C_SRCS_))
C_OBJS_ = $(C_SRCS_:.c=.o)
C_OBJS = $(addprefix $(OUT)/,$(C_OBJS_))
@@ -172,7 +168,7 @@
$(LD) -o $(OUT)/hypersrc $(C_OBJS) $(LD_FLAGS) $(LIBS) $(OUT)/libparser.a
$(OUT)/%.o: src/%.c
- $(CC) -o $@ $(CC_FLAGS) $(subst $(OUT)/,src/,$<)
+ $(CC) -c -o $@ $(CC_FLAGS) $(subst $(OUT)/,src/,$<)
# -----------------------------------------------------------------------------
# parser (lex/yacc code that builds func graph/tree)
@@ -210,13 +206,13 @@
mv y.tab.[cho] $(OUT)
$(OUT)/y.tab.o: $(OUT)/y.tab.c
- $(CC) -o $@ $(CC_FLAGS_PARSER) $(OUT)/y.tab.c
+ $(CC) -c -o $@ $(CC_FLAGS_PARSER) $(OUT)/y.tab.c
$(OUT)/lex.yy.o: $(OUT)/lex.yy.c
- $(CC) -o $@ $(CC_FLAGS_PARSER) $(OUT)/lex.yy.c
+ $(CC) -c -o $@ $(CC_FLAGS_PARSER) $(OUT)/lex.yy.c
$(OUT)/str_heap.o: src/str_heap.c $(INC_DIR)/str_heap.h
- $(CC) -o $@ $(CC_FLAGS_PARSER) src/str_heap.c
+ $(CC) -c -o $@ $(CC_FLAGS_PARSER) src/str_heap.c
# -----------------------------------------------------------------------------
@@ -235,10 +231,11 @@
@
cat Hypersrc.pl \
| sed 's|\$hypersrc = "hypersrc"|\$hypersrc = "${INSTALL_DIR}/hypersrc"|' \
- | sed 's|\$ctags_pl = "ctags.pl"|\$ctags_pl = "${INSTALL_DIR}/ctags.pl"|' > $(INSTALL_DIR)/Hypersrc.pl
+ | sed 's|\$ctags_pl = "ctags.pl"|\$ctags_pl = "${INSTALL_DIR}/ctags.pl"|' > $(OUT)/Hypersrc.pl
+ ${BSD_INSTALL_SCRIPT} $(OUT)/Hypersrc.pl $(INSTALL_DIR)
@
- cp $(OUT)/hypersrc $(INSTALL_DIR)
- cp ctags.pl $(INSTALL_DIR)
+ ${BSD_INSTALL_PROGRAM} $(OUT)/hypersrc $(INSTALL_DIR)
+ ${BSD_INSTALL_SCRIPT} ctags.pl $(INSTALL_DIR)
@
chmod +rx $(INSTALL_DIR)/hypersrc
chmod +rx $(INSTALL_DIR)/Hypersrc.pl
|