Skip to content

Commit aa2a388

Browse files
committed
Merge pull request cloudflare#26 from mtl1979/includes
Use INCLUDES in root Makefile.in too
2 parents 094b261 + 980713c commit aa2a388

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Makefile.in

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ EXE=
4949

5050
SRCDIR=.
5151
BSDLIBS=
52+
INCLUDES=-I$(SRCDIR)
5253

5354
ARCHDIR=arch/generic
5455
ARCH_STATIC_OBJS=
@@ -132,7 +133,7 @@ test64: all64
132133
rm -f $$TMP64
133134

134135
infcover.o: $(SRCDIR)/test/infcover.c $(SRCDIR)/zlib.h zconf.h
135-
$(CC) $(CFLAGS) -I. -I$(SRCDIR) -c -o $@ $(SRCDIR)/test/infcover.c
136+
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c
136137

137138
infcover: infcover.o libz.a
138139
$(CC) $(CFLAGS) -o $@ infcover.o libz.a $(BSDLIBS)
@@ -147,25 +148,25 @@ $(STATICLIB): $(OBJS)
147148
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
148149

149150
example.o: $(SRCDIR)/test/example.c $(SRCDIR)/zlib.h zconf.h
150-
$(CC) $(CFLAGS) -I. -I$(SRCDIR) -c -o $@ $(SRCDIR)/test/example.c
151+
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/example.c
151152

152153
minigzip.o: $(SRCDIR)/test/minigzip.c $(SRCDIR)/zlib.h zconf.h
153-
$(CC) $(CFLAGS) -I. -I$(SRCDIR) -c -o $@ $(SRCDIR)/test/minigzip.c
154+
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/minigzip.c
154155

155156
example64.o: $(SRCDIR)/test/example.c $(SRCDIR)/zlib.h zconf.h
156-
$(CC) $(CFLAGS) -I. -I$(SRCDIR) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/example.c
157+
$(CC) $(CFLAGS) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/example.c
157158

158159
minigzip64.o: $(SRCDIR)/test/minigzip.c $(SRCDIR)/zlib.h zconf.h
159-
$(CC) $(CFLAGS) -I. -I$(SRCDIR) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/minigzip.c
160+
$(CC) $(CFLAGS) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/minigzip.c
160161

161162
.SUFFIXES: .lo
162163

163164
%.o: $(SRCDIR)/%.c
164-
$(CC) -I. -I$(SRCDIR) $(CFLAGS) -c -o $@ $<
165+
$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $<
165166

166167
%.lo: $(SRCDIR)/%.c
167168
-@mkdir objs 2>/dev/null || test -d objs
168-
$(CC) -I. -I$(SRCDIR) $(SFLAGS) -DPIC -c -o objs/$*.o $<
169+
$(CC) $(INCLUDES) $(SFLAGS) -DPIC -c -o objs/$*.o $<
169170
-@mv objs/$*.o $@
170171

171172
placebo $(SHAREDTARGET): $(PIC_OBJS) $(STATICLIB)

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,10 @@ echo ARCH_STATIC_OBJS = ${ARCH_STATIC_OBJS} >> configure.log
760760
echo ARCH_SHARED_OBJS = ${ARCH_SHARED_OBJS} >> configure.log
761761

762762
# update Makefile with the configure results
763+
764+
INCLUDES="-I$SRCDIR"
765+
if [ "$SRCDIR" != "$BUILDDIR" ]; then INCLUDES="-I$BUILDDIR ${INCLUDES}"; fi
766+
763767
sed < $SRCDIR/Makefile.in "
764768
/^CC *=/s#=.*#=$CC#
765769
/^CFLAGS *=/s#=.*#=$CFLAGS#
@@ -786,6 +790,7 @@ sed < $SRCDIR/Makefile.in "
786790
/^mandir *=/s#=.*#=$mandir#
787791
/^SRCDIR *=/s#=.*#=$SRCDIR#
788792
/^BSDLIBS *=/s#=.*#=$BSDLIBS#
793+
/^INCLUDES *=/s#=.*#=$INCLUDES#
789794
/^OBJC *=/s#=.*#= $OBJC#
790795
/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
791796
/^all: */s#:.*#: $ALL#

0 commit comments

Comments
 (0)