hack Makefile to not ignore CC and CFLAGS

This commit is contained in:
jakob 2002-10-29 11:14:22 +00:00
parent 5ce35faa32
commit 424bbb2461
2 changed files with 77 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2002/10/28 01:38:45 naddy Exp $ # $OpenBSD: Makefile,v 1.3 2002/10/29 11:14:22 jakob Exp $
COMMENT= authorative only name server daemon COMMENT= authorative only name server daemon
@ -20,7 +20,8 @@ PERMIT_DISTFILES_FTP= Yes
MAKE_FLAGS+= PREFIX='${PREFIX}' \ MAKE_FLAGS+= PREFIX='${PREFIX}' \
NSDZONESDIR=/var/nsd \ NSDZONESDIR=/var/nsd \
NSDZONES=/var/nsd/nsd.zones \ NSDZONES=/var/nsd/nsd.zones \
NSDUSER=named NSDUSER=named \
CC='${CC}' CFLAGS='${CFLAGS}'
NO_REGRESS= Yes NO_REGRESS= Yes

View File

@ -0,0 +1,74 @@
$OpenBSD: patch-Makefile,v 1.1 2002/10/29 11:14:22 jakob Exp $
--- Makefile.orig Thu Aug 22 13:40:52 2002
+++ Makefile Tue Oct 29 12:09:10 2002
@@ -158,11 +158,15 @@ LIBS =
# Compile environment settings
DEBUG = # -g -DDEBUG=1
-CC=gcc
-CFLAGS = -ansi -pipe -O6 -Wall ${DEBUG} ${DBFLAGS} ${FEATURES} \
- -DCF_PIDFILE=\"${NSDPIDFILE}\" -DCF_DBFILE=\"${NSDDB}\" -DCF_USERNAME=\"${NSDUSER}\"
-LDFLAGS= ${LIBS}
-INSTALL = install -c
+CC = gcc
+CFLAGS = -ansi -pipe -O6 -Wall ${DEBUG}
+DEFS = ${DBFLAGS} ${FEATURES} -DCF_PIDFILE=\"${NSDPIDFILE}\" \
+ -DCF_DBFILE=\"${NSDDB}\" -DCF_USERNAME=\"${NSDUSER}\"
+LDFLAGS = ${LIBS}
+
+COMPILE = ${CC} ${CFLAGS} ${DEFS} -c
+LINK = ${CC} ${LDFLAGS}
+INSTALL = install -c
# This might be necessary for a system like SunOS 4.x
COMPAT_O = # basename.o
@@ -177,7 +181,7 @@ CLEANFILES+=*.core *.gmon
all: nsd zonec nsdc.sh nsd-notify
.c.o:
- ${CC} -c ${CFLAGS} $<
+ ${COMPILE} $<
install: nsd zonec nsdc.sh
[ -d ${NSDBINDIR} ] || mkdir ${NSDBINDIR}
@@ -201,29 +205,32 @@ nsdc.sh: nsdc.sh.in Makefile
chmod a+x $@
nsd: nsd.h dns.h nsd.o server.o query.o dbaccess.o rbtree.o hash.o
- ${CC} ${CFLAGS} ${LDFLAGS} ${LIBWRAP} -o $@ nsd.o server.o query.o dbaccess.o rbtree.o hash.o
+ ${LINK} ${LIBWRAP} -o $@ nsd.o server.o query.o dbaccess.o rbtree.o hash.o
zonec: zf.h dns.h zonec.h zf.o zonec.o dbcreate.o rbtree.o hash.o rfc1876.o ${COMPAT_O}
- ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonec.o zf.o dbcreate.o rbtree.o hash.o rfc1876.o ${COMPAT_O}
+ ${LINK} -o $@ zonec.o zf.o dbcreate.o rbtree.o hash.o rfc1876.o ${COMPAT_O}
nsd-notify: nsd-notify.c query.o dbaccess.o zf.o rbtree.o rfc1876.o
- ${CC} ${CFLAGS} ${LDFLAGS} ${LIBWRAP} -o $@ nsd-notify.c query.o dbaccess.o zf.o rbtree.o rfc1876.o
+ ${LINK} ${LIBWRAP} -o $@ nsd-notify.c query.o dbaccess.o zf.o rbtree.o rfc1876.o
clean:
rm -f zonec nsd zf hash rbtree nsd-notify *.o y.* *.core *.gmon nsd.db nsdc.sh
basename.o: compat/basename.c
- ${CC} -c ${CFLAGS} compat/basename.c -o basename.o
+ ${COMPILE} compat/basename.c -o basename.o
# Test programs
rbtree: rbtree.c rbtree.h
- ${CC} ${CFLAGS} ${LDFLAGS} -DTEST -o $@ rbtree.c
+ ${COMPILE} -DTEST rbtree.c
+ ${LINK} -o $@ rbtree.o
hash: hash.c hash.h
- ${CC} ${CFLAGS} ${LDFLAGS} -DTEST -o $@ hash.c
+ ${COMPILE} -DTEST hash.c
+ ${LINK} -o $@ hash.o
-zf: zf.h dns.h zf.c
- ${CC} ${CFLAGS} ${LDFLAGS} -DTEST -o $@ zf.c
+zf: zf.h dns.h zf.c rfc1876.c
+ ${COMPILE} -DTEST zf.c rfc1876.c
+ ${LINK} -o $@ zf.o rfc1876.o
${OBJS}: ${HDRS}