Low-level, but significant cleanup of Perl's build process.
This should significantly ease "make; make install" loops.
This commit is contained in:
parent
fb3fd47611
commit
3ea5059f1e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51629
@ -1,6 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PERL5SRC?= ${.CURDIR}/../../../../contrib/perl5
|
||||
PERL5LIB?= ${.CURDIR}/../libperl
|
||||
|
||||
BINDIR?= /usr/bin
|
||||
|
||||
@ -25,8 +26,8 @@ CLEANFILES+= ${.OBJDIR}/${I}
|
||||
DEPEND_H+= ${.OBJDIR}/${I}
|
||||
.endfor
|
||||
|
||||
linkfarm: ${DEPEND_H}
|
||||
@for d in ${CLEANDIRS} ; do \
|
||||
links: ${DEPEND_H}
|
||||
@for d in ${FARMDIRS} ; do \
|
||||
rm -rf $${d} ;\
|
||||
for i in `cd ${PERL5SRC}; find $${d} -type d -a \! -name CVS` ;\
|
||||
do \
|
||||
@ -47,8 +48,36 @@ linkfarm: ${DEPEND_H}
|
||||
@ln -sf ${PERL5SRC}/writemain.SH writemain.sh
|
||||
@ln -sf ${PERL5SRC}/regcomp.c regcomp.c
|
||||
@ln -sf ${PERL5SRC}/regexec.c regexec.c
|
||||
@ln -sf ${CANONICALOBJDIR}/../libperl/config.sh config.sh
|
||||
@touch ${.TARGET}
|
||||
|
||||
CLEANFILES+= linkfarm
|
||||
CLEANFILES+= links
|
||||
CLEANFILES+= config.h config.sh config_h.sh
|
||||
CLEANFILES+= regcomp.c regexec.c
|
||||
CLEANFILES+= writemain writemain.sh config_h.sh cflags cflags.sh myconfig
|
||||
CLEANDIRS+= lib ext Porting hints build
|
||||
FARMDIRS= lib ext Porting hints
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "yes"
|
||||
CFLAGS+= -pthread
|
||||
THREAD= threads-
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "yes"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
|
||||
config.sh: ${PERL5LIB}/config.SH-${THREAD}${OBJFORMAT}.${MACHINE_ARCH}
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
|
||||
config.h: links config_h.sh config.sh
|
||||
sh config_h.sh
|
||||
|
||||
cflags.sh config_h.sh writemain.sh: links
|
||||
|
||||
cflags: cflags.sh
|
||||
sh cflags.sh
|
||||
|
||||
writemain: writemain.sh
|
||||
sh writemain.sh
|
||||
|
@ -13,38 +13,10 @@ SRCS= perl.c gv.c toke.c perly.c op.c regcomp.c dump.c util.c mg.c byterun.c \
|
||||
|
||||
# NOPIC= true
|
||||
|
||||
beforeinstall beforedepend all: config.h config.sh
|
||||
|
||||
CLEANFILES+= config.h config.sh config_h.sh
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "true"
|
||||
CFLAGS+= -pthread
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "true"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
.SUFFIXES: .o .po .So .s .S .c
|
||||
|
||||
.PATH: ${PERL5SRC}
|
||||
|
||||
config.h: config_h.sh config.sh
|
||||
sh config_h.sh
|
||||
|
||||
.if ${PERL_THREADED} == "true"
|
||||
config.sh: config.SH-threads-${OBJFORMAT}.${MACHINE_ARCH}
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
.else
|
||||
config.sh: config.SH-${OBJFORMAT}.${MACHINE_ARCH}
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
.endif
|
||||
|
||||
config_h.sh: config_h.SH
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
|
@ -15,33 +15,6 @@ LDADD= -lperl -lm -lcrypt
|
||||
# This gets overwritten.
|
||||
LINKS= ${BINDIR}/${PROG} ${BINDIR}/perl
|
||||
|
||||
CLEANFILES= config.h config.sh config_h.sh
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "true"
|
||||
CFLAGS+= -pthread
|
||||
LDADD+= -pthread
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "true"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
|
||||
miniperlmain.o: config.h
|
||||
|
||||
config.h: config_h.sh config.sh
|
||||
sh config_h.sh
|
||||
|
||||
${.CURDIR}/../libperl/config.sh:
|
||||
cd ${.CURDIR}/../libperl ; make config.sh
|
||||
|
||||
config.sh: ${.CURDIR}/../libperl/config.sh
|
||||
ln -sf ${CANONICALOBJDIR}/../libperl/config.sh ${.TARGET}
|
||||
|
||||
config_h.sh: config_h.SH
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
|
||||
.PATH: ${PERL5SRC}
|
||||
|
@ -12,9 +12,8 @@ LDADD= lib/auto/DynaLoader/DynaLoader.a -lperl -lm -lcrypt
|
||||
LINKS= ${BINDIR}/${PROG} ${BINDIR}/perl5 \
|
||||
${BINDIR}/${PROG} ${BINDIR}/perl5.00503
|
||||
|
||||
CLEANFILES= config.h config.sh config_h.sh writemain writemain.sh \
|
||||
Config.pm cflags cflags.sh myconfig perlmain.c miniperlmain.c \
|
||||
autosplit regcomp.c regexec.c pod2man.PL pod2man ext.libs \
|
||||
CLEANFILES= Config.pm perlmain.c \
|
||||
autosplit pod2man.PL pod2man ext.libs \
|
||||
man3pages
|
||||
|
||||
STATIC_EXT= DynaLoader/DynaLoader
|
||||
@ -22,59 +21,39 @@ STATIC_EXT= DynaLoader/DynaLoader
|
||||
DYNAMIC_EXT= B/B DB_File/DB_File Data/Dumper/Dumper Fcntl/Fcntl IO/IO \
|
||||
IPC/SysV/SysV NDBM_File/NDBM_File Opcode/Opcode POSIX/POSIX \
|
||||
SDBM_File/SDBM_File Socket/Socket attrs/attrs re/re
|
||||
.if ${PERL_THREADED} == "yes"
|
||||
DYNAMIC_EXT+= Thread/Thread
|
||||
.endif
|
||||
|
||||
NONXS_EXT= Errno/pm_to_blib
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "true"
|
||||
DYNAMIC_EXT+= Thread/Thread
|
||||
CFLAGS+= -pthread
|
||||
LDADD+= -pthread
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "true"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
${PROG}: Config.pm autosplit lib/auto/DynaLoader/DynaLoader.a
|
||||
|
||||
${PROG}: linkfarm Config.pm autosplit lib/auto/DynaLoader/DynaLoader.a
|
||||
|
||||
config_h.sh config.sh cflags.sh writemain.sh: linkfarm
|
||||
|
||||
config.h: linkfarm config_h.sh config.sh
|
||||
sh -x config_h.sh
|
||||
|
||||
cflags: linkfarm cflags.sh
|
||||
sh cflags.sh
|
||||
|
||||
Config.pm: linkfarm ${PERL5SRC}/configpm myconfig config.sh
|
||||
Config.pm: links ${PERL5SRC}/configpm myconfig config.sh
|
||||
miniperl ${PERL5SRC}/configpm \
|
||||
Config.pm Porting/Glossary myconfig config.sh
|
||||
cd lib ; ln -sf ../${.TARGET}
|
||||
|
||||
perlmain.c: linkfarm writemain config.h
|
||||
perlmain.c: config.sh writemain config.h
|
||||
sh writemain lib/auto/DynaLoader/DynaLoader.a > ${.TARGET}
|
||||
|
||||
writemain: linkfarm writemain.sh
|
||||
sh writemain.sh
|
||||
|
||||
autosplit: linkfarm Config.pm lib/*.pm lib/*/*.pm
|
||||
autosplit: links Config.pm lib/*.pm lib/*/*.pm
|
||||
miniperl -I${.OBJDIR}/lib \
|
||||
-e 'use AutoSplit; autosplit_lib_modules(@ARGV)' \
|
||||
lib/*.pm lib/*/*.pm
|
||||
touch ${.TARGET}
|
||||
|
||||
.for I in ${STATIC_EXT}
|
||||
ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm config.h
|
||||
ext/${I:H}/Makefile: links ext/${I:H}/Makefile.PL cflags Config.pm config.h
|
||||
cd ext/${I:H}; \
|
||||
miniperl -I${.OBJDIR}/lib Makefile.PL \
|
||||
LINKTYPE=static INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
|
||||
LIBS="-lperl" INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3; \
|
||||
make -B config PERL_SRC=${.OBJDIR}
|
||||
|
||||
lib/auto/${I}.a: linkfarm ext/${I:H}/Makefile
|
||||
lib/auto/${I}.a: links ext/${I:H}/Makefile
|
||||
cd ext/${I:H}; \
|
||||
make -B all PERL_SRC=${.OBJDIR}
|
||||
|
||||
@ -84,7 +63,7 @@ STATICS+= lib/auto/${I}.a
|
||||
.endfor
|
||||
|
||||
.for I in ${DYNAMIC_EXT}
|
||||
ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm pod2man config.h
|
||||
ext/${I:H}/Makefile: links ext/${I:H}/Makefile.PL cflags Config.pm pod2man config.h
|
||||
cd ext/${I:H}; \
|
||||
miniperl -I${.OBJDIR}/lib Makefile.PL \
|
||||
LINKTYPE=dynamic INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
|
||||
@ -94,7 +73,7 @@ ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm pod2man co
|
||||
make -B config PERL_SRC=${.OBJDIR}
|
||||
|
||||
|
||||
lib/auto/${I}.so: linkfarm ${PROG} ext/${I:H}/Makefile
|
||||
lib/auto/${I}.so: links ${PROG} ext/${I:H}/Makefile
|
||||
cd ext/${I:H}; \
|
||||
make -B all PERL_SRC=${.OBJDIR}
|
||||
|
||||
@ -104,7 +83,7 @@ DYNAMICS+= lib/auto/${I}.so
|
||||
.endfor
|
||||
|
||||
.for I in ${NONXS_EXT}
|
||||
ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags lib/Config.pm
|
||||
ext/${I:H}/Makefile: links ext/${I:H}/Makefile.PL cflags lib/Config.pm
|
||||
mkdir -p ${.OBJDIR}/lib/auto/${I:H} ;\
|
||||
cd ext/${I:H} ;\
|
||||
miniperl -I${.OBJDIR}/lib Makefile.PL \
|
||||
@ -114,7 +93,7 @@ ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags lib/Config.pm
|
||||
INST_ARCHLIB=${.OBJDIR}/lib/auto/${I:H} ;\
|
||||
make -B config PERL_SRC=${.OBJDIR}
|
||||
|
||||
lib/auto/${I}: linkfarm ${PROG} ext/${I:H}/Makefile
|
||||
lib/auto/${I}: links ${PROG} ext/${I:H}/Makefile
|
||||
cd ext/${I:H}; \
|
||||
make -B all LINKTYPE=nonxs PERL_SRC=${.OBJDIR}
|
||||
|
||||
|
@ -13,63 +13,42 @@ BINOWN= root
|
||||
BINMODE=4511
|
||||
LINKS= ${BINDIR}/${PROG} ${BINDIR}/sperl5.00503
|
||||
|
||||
|
||||
CLEANFILES= config.h config.sh config_h.sh writemain writemain.sh \
|
||||
Config.pm cflags cflags.sh myconfig perlmain.c miniperlmain.c \
|
||||
autosplit regcomp.c regexec.c ext.libs sperl.c
|
||||
CLEANFILES= Config.pm perlmain.c sperl.c \
|
||||
autosplit pod2man.PL pod2man ext.libs \
|
||||
man3pages
|
||||
|
||||
STATIC_EXT= DynaLoader/DynaLoader
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "true"
|
||||
CFLAGS+= -pthread
|
||||
LDADD+= -pthread
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "true"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
|
||||
${PROG}: linkfarm Config.pm autosplit lib/auto/DynaLoader/DynaLoader.a
|
||||
${PROG}: Config.pm autosplit lib/auto/DynaLoader/DynaLoader.a
|
||||
|
||||
sperl.c: perl.c
|
||||
@ln -sf ${.OODATE} ${.TARGET}
|
||||
|
||||
config.h: linkfarm
|
||||
sh config_h.sh
|
||||
|
||||
cflags: linkfarm
|
||||
sh cflags.sh
|
||||
|
||||
Config.pm: linkfarm
|
||||
Config.pm: links ${PERL5SRC}/configpm myconfig config.sh
|
||||
miniperl ${PERL5SRC}/configpm \
|
||||
Config.pm Porting/Glossary myconfig config.sh
|
||||
cd lib ; ln -sf ../${.TARGET}
|
||||
|
||||
perlmain.c: linkfarm writemain config.h
|
||||
perlmain.c: config.sh writemain config.h
|
||||
sh writemain lib/auto/DynaLoader/DynaLoader.a > ${.TARGET}
|
||||
|
||||
writemain: linkfarm
|
||||
sh writemain.sh
|
||||
|
||||
autosplit: linkfarm Config.pm lib/*.pm lib/*/*.pm
|
||||
autosplit: links Config.pm lib/*.pm lib/*/*.pm
|
||||
miniperl -I${.OBJDIR}/lib \
|
||||
-e 'use AutoSplit; autosplit_lib_modules(@ARGV)' \
|
||||
lib/*.pm lib/*/*.pm
|
||||
touch ${.TARGET}
|
||||
|
||||
.for I in ${STATIC_EXT}
|
||||
ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm
|
||||
ext/${I:H}/Makefile: links ext/${I:H}/Makefile.PL cflags Config.pm
|
||||
cd ext/${I:H}; \
|
||||
miniperl -I${.OBJDIR}/lib Makefile.PL \
|
||||
LINKTYPE=static INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
|
||||
LIBS="-lperl" INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3; \
|
||||
make -B config PERL_SRC=${.OBJDIR}
|
||||
|
||||
lib/auto/${I}.a: linkfarm ext/${I:H}/Makefile
|
||||
lib/auto/${I}.a: links ext/${I:H}/Makefile
|
||||
cd ext/${I:H}; \
|
||||
make -B all PERL_SRC=${.OBJDIR}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
PERL5SRC= ${.CURDIR}/../../../../../contrib/perl5
|
||||
PERL5LIB= ${.CURDIR}/../../libperl
|
||||
MINIPERLOPT?= -I${.OBJDIR}/../../perl/lib -I${.OBJDIR}/../../perl
|
||||
|
||||
STRIP=
|
||||
|
@ -7,43 +7,21 @@ CFLAGS+=-I${PERL5SRC}/x2p -I${.OBJDIR} -I${.OBJDIR}/temp
|
||||
LDFLAGS+=-lperl -lm -lcrypt
|
||||
SRCS= a2p.c hash.c str.c util.c walk.c config.h
|
||||
|
||||
beforedepend all: config.h temp
|
||||
CLEANDIRS+= temp
|
||||
CLEANFILES+= ${PROG}.1
|
||||
|
||||
config.h: temp
|
||||
|
||||
temp:
|
||||
@mkdir temp
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
PERL_THREADED?= no
|
||||
.if ${PERL_THREADED} == "true"
|
||||
CFLAGS+= -pthread
|
||||
LDADD+= -pthread
|
||||
.endif
|
||||
|
||||
PERL_DEBUGGING?= no
|
||||
.if ${PERL_DEBUGGING} == "true"
|
||||
CFLAGS+= -DDEBUGGING
|
||||
.endif
|
||||
|
||||
.PATH: ${PERL5SRC}/x2p
|
||||
.PATH: ${PERL5SRC}
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .h .o
|
||||
|
||||
temp:
|
||||
@mkdir temp
|
||||
|
||||
CLEANFILES+= config.h config_h.sh config.sh ${PROG}.1
|
||||
|
||||
config.h: config_h.sh config.sh
|
||||
sh config_h.sh
|
||||
|
||||
${.CURDIR}/../../libperl/config.sh:
|
||||
cd ${.CURDIR}/../../libperl ; make config.sh
|
||||
|
||||
config.sh: ${.CURDIR}/../../libperl/config.sh
|
||||
ln -sf ${CANONICALOBJDIR}/../../libperl/config.sh ${.TARGET}
|
||||
|
||||
config_h.sh: ${PERL5SRC}/config_h.SH
|
||||
ln -sf ${.OODATE} ${.TARGET}
|
||||
|
||||
${PROG}.1: ${PROG}.pod
|
||||
miniperl ${MINIPERLOPT} ${.OBJDIR}/../../pod/pod2man/pod2man ${.OODATE} > ${.TARGET}
|
||||
|
Loading…
Reference in New Issue
Block a user