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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
Search our custom $(LIB_DIRS) path before the stuff
gtk-config injects in $(LIBS).
http://bugs.gentoo.org/94867
Make sure we respect CFLAGS / CXXFLAGS
--- libjsw-1.5.5/jscalibrator/Makefile
+++ libjsw-1.5.5/jscalibrator/Makefile
@@ -59,8 +59,6 @@
#CFLAGS = -Wall -O -g \
# `gtk-config --cflags`
-CFLAGS = -Wall -O6 -fomit-frame-pointer -funroll-loops -ffast-math \
- `gtk-config --cflags`
CPPFLAGS = -D__cplusplus
@@ -76,7 +74,7 @@
# to the LIB line depending on what you have set in the CFLAGS line
# farther above.
#
-LIBS = -ljsw `gtk-config --libs`
+LIBS := -ljsw $(shell gtk-config --libs)
# Library Directories:
#
@@ -85,7 +83,7 @@
# Each argument is of the format -L<dir> where <dir> is the full
# path to the directory.
#
-LIB_DIRS =
+LIB_DIRS = -L../libjsw
# Header File Directories:
#
@@ -95,7 +93,7 @@
# Each argument is of the format -I<dir> where <dir> is the full
# path to the directory.
#
-INC_DIRS =
+INC_DIRS := $(shell gtk-config --cflags) -I../libjsw
# ########################################################################
@@ -117,11 +115,9 @@
OBJ_C = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
- @echo "Compiling module $*.o"
- @+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
+ $(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
.cpp.o:
- @echo "Compiling module $*.o"
- @+$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)
+ $(CPP) -c $*.cpp $(INC_DIRS) $(CXXFLAGS) $(CPPFLAGS)
# ########################################################################
@@ -130,10 +126,7 @@
$(BIN): prebuild modules postbuild
modules: $(OBJ_C) $(OBJ_CPP)
- @echo -n "Linking modules..."
- @$(CPP) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIBS) $(LIB_DIRS)
- @echo -n " "
- @-$(LS) $(LSFLAGS) $(BIN)
+ $(CPP) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LDFLAGS) $(LIB_DIRS) $(LIBS)
prebuild:
@echo "Building program \"$(BIN)\"..."
--- libjsw-1.5.5/libjsw/Makefile
+++ libjsw-1.5.5/libjsw/Makefile
@@ -51,11 +51,10 @@
# to debug the program.
#
-CFLAGS = -Wall -O6 \
- -fomit-frame-pointer -funroll-loops -ffast-math \
- -finline-functions
+CFLAGS += -fPIC
+CXXFLAGS += -fPIC
-CPPFLAGS = -D__cplusplus
+CPPFLAGS += -D__cplusplus
# ########################################################################
@@ -83,11 +82,9 @@
OBJ_C = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
- @echo "Compiling module $*.o"
- @+$(CC) -c $*.c $(INC) $(CFLAGS)
+ $(CC) -c $*.c $(INC) $(CFLAGS)
.cpp.o:
- @echo "Compiling module $*.o"
- @+$(CPP) -c $*.cpp $(INC) $(CFLAGS) $(CPPFLAGS)
+ $(CPP) -c $*.cpp $(INC) $(CXXFLAGS) $(CPPFLAGS)
# ########################################################################
@@ -96,10 +93,7 @@
$(LIB): prebuild modules postbuild
modules: $(OBJ_C) $(OBJ_CPP)
- @echo -n "Linking modules..."
- @$(CPP) $(OBJ_C) $(OBJ_CPP) -o $(LIB) $(LIBS) $(LIB_DIRS)
- @echo -n " "
- @-$(LS) $(LSFLAGS) $(LIB)
+ $(CPP) $(OBJ_C) $(OBJ_CPP) -o $(LIB) $(LDFLAGS) $(LIBS) $(LIB_DIRS)
prebuild:
@echo "Building library \"$(LIB)\"..."
|