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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
Description: Preserve external build flags during the build
Author: Stephen Kitt <skitt@debian.org>
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,6 @@
INCLDIR= $(PREFIX)/lib/bcc
ASLDDIR= $(BINDIR)
MANDIR= $(PREFIX)/man
-CFLAGS= -O
IFDEFNAME= ifdef
# Some makes take the last of a list as the default ...
--- a/makefile.in
+++ b/makefile.in
@@ -13,9 +13,6 @@
# Defaults, generic C
ARFLAGS =r
-CC =%CC%
-CFLAGS =%CFLAGS%
-LDFLAGS =
MAKEARG =CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
PREFIX=$(PREFIX) LIBDIR='$(LIBDIR)' \
BINDIR='$(BINDIR)' ANSI='$(ANSI)'
@@ -43,7 +40,7 @@
CFLAGS =$(GCCFLAG) $(WALL) -O2 -g
#else
WALL =-Wall -Wstrict-prototypes -Wno-error=implicit-function-declaration
-CFLAGS =$(GCCFLAG) -O2 -fno-strict-aliasing
+CFLAGS +=$(GCCFLAG) -O2 -fno-strict-aliasing
#endif
#endif
@@ -81,7 +78,7 @@
# Install files with the userid of the currently running process.
INDAT=-m 644
-INEXE=-m 755 -s
+INEXE=-m 755
INSCR=-m 755
#ifdef __CYGWIN__
--- a/cpp/Makefile
+++ b/cpp/Makefile
@@ -1,9 +1,7 @@
-CFLAGS=-Wall -Wstrict-prototypes
-
all: bcc-cpp
bcc-cpp: main.o cpp.o hash.o token1.o token2.o
- $(CC) $(CFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
clean realclean:
rm -f bcc-cpp main.o cpp.o hash.o token1.o token2.o tmp.h
--- a/ar/Makefile
+++ b/ar/Makefile
@@ -3,8 +3,6 @@
# distributed under the GNU General Public License.
LIBDIR =/usr/bin
-CFLAGS =-O
-LDFLAGS =
DEFS =
OBJS= ar.o alloca.o
@@ -31,6 +29,3 @@
test -f rel_aout.h || \
{ rm -f rel_aout.h ; ln -s ../ld/rel_aout.h . ; } || \
ln ../ld/rel_aout.h .
-
-.c.o:
- $(CC) $(CFLAGS) $(DEFS) -c $< -o $@
--- a/as/Makefile
+++ b/as/Makefile
@@ -1,6 +1,4 @@
-CFLAGS=-O
-LDFLAGS=-s
LIBDIR=/usr/bin
BINDIR=/usr/bin
@@ -19,7 +17,7 @@
< as86_encap.sh > tmp
@mv -f tmp $@
chmod +x $@
-
+
install: all
install -d $(LIBDIR)
install -m 755 as86 $(LIBDIR)
@@ -30,9 +28,6 @@
clean realclean clobber:
rm -f *.o as86 as86_encap
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
$(OBJS): const.h errors.h
as.o: const.h type.h byteord.h macro.h file.h flag.h globvar.h
--- a/bin86/Makefile
+++ b/bin86/Makefile
@@ -1,6 +1,5 @@
-CFLAGS=-O2 -D_POSIX_SOURCE
-LDFLAGS=
+CFLAGS+=-D_POSIX_SOURCE
DIRS=ld as
PREFIX=/usr/local
--- a/copt/Makefile
+++ b/copt/Makefile
@@ -1,6 +1,6 @@
copt: copt.c
- $(CC) $(ANSI) $(CFLAGS) $(LDFLAGS) -o $@ copt.c
+ $(CC) $(CPPFLAGS) $(ANSI) $(CFLAGS) $(LDFLAGS) -o $@ copt.c
realclean clean:
rm -f *.o copt
--- a/dis88/Makefile
+++ b/dis88/Makefile
@@ -25,8 +25,6 @@
# be necessary to alter the formats of the tables.
#CC=bcc
-CFLAGS=-O
-LDFLAGS=
PREFIX=/usr
OBJ = disrel.o dismain.o distabs.o dishand.o disfp.o
--- a/ld/Makefile
+++ b/ld/Makefile
@@ -1,7 +1,5 @@
LIBDIR =/usr/bin
-CFLAGS =-O
-LDFLAGS =
# Will need some of these if you want native executables on non-Linux/i386
# -DDETECTAOUT # Turn on detection.
@@ -41,9 +39,9 @@
ln ../libc/include/ar.h .
writebin.o: writebin.c
- $(CC) $(CFLAGS) $(DEFS) $(NATIVE) -c $<
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(NATIVE) -c $<
writerel.o: writebin.c
.c.o:
- $(CC) $(CFLAGS) $(DEFS) -c $< -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $< -o $@
--- a/unproto/Makefile
+++ b/unproto/Makefile
@@ -81,18 +81,16 @@
OBJECTS = tok_io.o tok_class.o tok_pool.o unproto.o vstring.o symbol.o error.o \
hash.o strsave.o
-CFLAGS = -O
-LDFLAGS =
CCFLAGS = $(CFLAGS) -w $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DREOPEN -Wno-error=implicit-function-declaration
#CFLAGS = -O $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -p -Dstatic=
#CFLAGS = -g $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DDEBUG
$(PROG): $(OBJECTS)
- $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(MALLOC)
+ $(CC) $(CPPFLAGS) $(CCFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(MALLOC)
.c.o:
- $(CC) $(CCFLAGS) -c $< -o $@
+ $(CC) $(CPPFLAGS) $(CCFLAGS) -c $< -o $@
# For linting, enable all bells and whistles.
--- a/bcc/Makefile
+++ b/bcc/Makefile
@@ -5,13 +5,11 @@
PREFIX=/usr
-CFLAGS =-O
-LDFLAGS =-s
BINDIR =$(PREFIX)/bin
LIBDIR =$(PREFIX)/lib/bcc
BCCDEFS =-DLOCALPREFIX=$(PREFIX) -DBINDIR=$(BINDIR) -DDEFARCH=0
-BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS)
+BCFLAGS=$(ANSI) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
OBJS = bcc-cc1.o codefrag.o dbnode.o declare.o express.o exptree.o floatop.o \
function.o gencode.o genloads.o glogcode.o hardop.o input.o label.o \
|