aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Karthauser <joe@FreeBSD.org>2000-11-02 13:16:43 +0000
committerJosef Karthauser <joe@FreeBSD.org>2000-11-02 13:16:43 +0000
commita5e7d98e8aba30dc6f4f992464c432cc006a3fc1 (patch)
tree32f713aeb058787b4e6c83ad9d640d6e73e4be57
parentc7afc3e07c6a427f24e531faee59ceb7a2083b23 (diff)
downloadsrc-a5e7d98e8aba30dc6f4f992464c432cc006a3fc1.tar.gz
src-a5e7d98e8aba30dc6f4f992464c432cc006a3fc1.zip
Post process the crunch1.mk file to allow make arguments to passed on
a per program basis allowing a greater control on what is built. The buildopts file contains Makefile lines of form: # Anything added to OPTS is added to every build rule. OPTS= -DNOPAM # These should only be added to the build of user-ppp. ppp_OPTS= -DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM -DNOSUID \ -DHAVE_DES -DNORADIUS -DNOI4B -DNONETGRAPH Really these should be added to crunch.inc, but that file is currently optional, and if defined masks the global one. Next step will be to move these global settings back out into the individual builds as OPTS, and then migrate OPTS and prog_OPTS back into the local crunch.inc file.
Notes
Notes: svn path=/head/; revision=68240
-rw-r--r--release/picobsd/build/Makefile.crunch8
-rwxr-xr-xrelease/picobsd/build/munge_crunchmk.pl30
-rw-r--r--release/picobsd/net/crunch1/buildopts.inc6
3 files changed, 43 insertions, 1 deletions
diff --git a/release/picobsd/build/Makefile.crunch b/release/picobsd/build/Makefile.crunch
index 248b76032251..96ceb1522803 100644
--- a/release/picobsd/build/Makefile.crunch
+++ b/release/picobsd/build/Makefile.crunch
@@ -13,7 +13,13 @@ crunch:
else \
crunchgen -h ../../build/crunch.inc ./crunch1.conf ; \
fi )
- @${MAKE} -f crunch1.mk $(CRUNCHFLAGS) all \
+ ../../build/munge_crunchmk.pl crunch1.mk ;
+ @( if [ -f buildopts.inc ] ; then \
+ echo '.include "buildopts.inc"' > crunch1.mk.tmp ; \
+ cat crunch1.mk >> crunch1.mk.tmp ; \
+ mv crunch1.mk.tmp crunch1.mk ; \
+ fi )
+ ${MAKE} -f crunch1.mk $(CRUNCHFLAGS) all \
"CFLAGS=${CFLAGS} ${CRUNCHFLAGS}" #2>&1 >/dev/null
strip --remove-section=.note --remove-section=.comment crunch1
diff --git a/release/picobsd/build/munge_crunchmk.pl b/release/picobsd/build/munge_crunchmk.pl
new file mode 100755
index 000000000000..8bfbac00a9e6
--- /dev/null
+++ b/release/picobsd/build/munge_crunchmk.pl
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -wi
+
+# Post process a crunch1.mk file:
+#
+# from...
+# ftp_make:
+# (cd $(ftp_SRCDIR) && make depend && make $(ftp_OBJS))
+#
+# to...
+# ftp_make:
+# (cd $(ftp_SRCDIR) && make obj && make depend && make $(OPTS) $(ftp_OPTS) $(ftp_OBJS))
+
+use strict;
+
+while (my $line = <>) {
+ if ( $line =~ /(.*)make depend && make (\$\((.*?)_OBJS\).*)/ ) {
+ my $start = $1; # The start of the line.
+ my $end = $2; # The end of the line.
+ my $prog = $3; # The parsed out name of the program.
+
+ print $start;
+ print 'make obj && make depend && ';
+ print 'make $(OPTS) $(' . $prog . '_OPTS) ';
+ print $end, "\n";
+ } else {
+ print $line;
+ }
+}
+
+#end
diff --git a/release/picobsd/net/crunch1/buildopts.inc b/release/picobsd/net/crunch1/buildopts.inc
new file mode 100644
index 000000000000..8e83165b3a7e
--- /dev/null
+++ b/release/picobsd/net/crunch1/buildopts.inc
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+OPTS= -DNOPAM
+ppp_OPTS= -DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM -DNOSUID -DHAVE_DES -DNORADIUS -DNOI4B -DNONETGRAPH
+
+#end