7 CFLAGS+=-I${PERL5SRC} -I${.OBJDIR}
8 SRCS= perlmain.c config.h
10 DPADD= lib/auto/DynaLoader/DynaLoader.a ${LIBPERL} ${LIBM} ${LIBCRYPT}
11 LDADD= lib/auto/DynaLoader/DynaLoader.a -lperl -lm -lcrypt
12 LINKS= ${BINDIR}/${PROG} ${BINDIR}/perl5 \
13 ${BINDIR}/${PROG} ${BINDIR}/perl5.00503
15 CLEANFILES= config.h config.sh config_h.sh writemain writemain.sh \
16 Config.pm cflags cflags.sh myconfig perlmain.c miniperlmain.c \
17 autosplit regcomp.c regexec.c pod2man.PL pod2man ext.libs \
20 STATIC_EXT= DynaLoader/DynaLoader
22 DYNAMIC_EXT= B/B DB_File/DB_File Data/Dumper/Dumper Fcntl/Fcntl IO/IO \
23 IPC/SysV/SysV NDBM_File/NDBM_File Opcode/Opcode POSIX/POSIX \
24 SDBM_File/SDBM_File Socket/Socket attrs/attrs re/re
26 NONXS_EXT= Errno/pm_to_blib
28 .include <bsd.prog.mk>
30 ${PROG}: linkfarm Config.pm autosplit lib/auto/DynaLoader/DynaLoader.a
32 config_h.sh config.sh cflags.sh writemain.sh: linkfarm
34 config.h: linkfarm config_h.sh config.sh
37 cflags: linkfarm cflags.sh
40 Config.pm: linkfarm ${PERL5SRC}/configpm myconfig config.sh
41 miniperl ${PERL5SRC}/configpm \
42 Config.pm Porting/Glossary myconfig config.sh
43 cd lib ; ln -sf ../${.TARGET}
45 perlmain.c: linkfarm writemain config.h
46 sh writemain lib/auto/DynaLoader/DynaLoader.a > ${.TARGET}
48 writemain: linkfarm writemain.sh
51 autosplit: linkfarm Config.pm lib/*.pm lib/*/*.pm
52 miniperl -I${.OBJDIR}/lib \
53 -e 'use AutoSplit; autosplit_lib_modules(@ARGV)' \
57 .for I in ${STATIC_EXT}
58 ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm config.h
60 miniperl -I${.OBJDIR}/lib Makefile.PL \
61 LINKTYPE=static INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
62 LIBS="-lperl" INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3; \
63 make -B config PERL_SRC=${.OBJDIR}
65 lib/auto/${I}.a: linkfarm ext/${I:H}/Makefile
67 make -B all PERL_SRC=${.OBJDIR}
71 STATICS+= lib/auto/${I}.a
74 .for I in ${DYNAMIC_EXT}
75 ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags Config.pm pod2man config.h
77 miniperl -I${.OBJDIR}/lib Makefile.PL \
78 LINKTYPE=dynamic INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
79 LIBS="-lperl" INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3 \
80 INST_LIB=${.OBJDIR}/build/${I:H} \
81 INST_ARCHLIB=${.OBJDIR}/build/${I:H} ;\
82 make -B config PERL_SRC=${.OBJDIR}
85 lib/auto/${I}.so: linkfarm ${PROG} ext/${I:H}/Makefile
87 make -B all PERL_SRC=${.OBJDIR}
91 DYNAMICS+= lib/auto/${I}.so
94 .for I in ${NONXS_EXT}
95 ext/${I:H}/Makefile: linkfarm ext/${I:H}/Makefile.PL cflags lib/Config.pm
96 mkdir -p ${.OBJDIR}/lib/auto/${I:H} ;\
98 miniperl -I${.OBJDIR}/lib Makefile.PL \
99 INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
100 INSTALLMAN3DIR=/usr/share/perl/man3 \
101 INST_LIB=${.OBJDIR}/lib/auto/${I:H} \
102 INST_ARCHLIB=${.OBJDIR}/lib/auto/${I:H} ;\
103 make -B config PERL_SRC=${.OBJDIR}
105 lib/auto/${I}: linkfarm ${PROG} ext/${I:H}/Makefile
107 make -B all LINKTYPE=nonxs PERL_SRC=${.OBJDIR}
109 NONXSS+= lib/auto/${I}
112 pod2man: Config.pm autosplit ${PERL5SRC}/pod/pod2man.PL
113 ln -sf ${PERL5SRC}/pod/pod2man.PL
114 miniperl -I${.OBJDIR}/lib pod2man.PL
118 for i in `find . -name \*.pm | grep -v Functions.pm` ; do \
119 j=`echo $$i | sed -e 's|./||' -e 's|/|::|g' -e 's|.pm|.3|'` ;\
120 echo Manifying $$j ;\
121 miniperl -I${.OBJDIR}/lib ${.OBJDIR}/pod2man $$i > $$j ;\
125 for i in `find . -name \*.pm -o -name \*.pod | grep -v POSIX.pm` ; do \
126 j=`echo $$i | sed -e 's|./||' -e 's|/SysV/|/IPC/|' \
127 -e 's|/Dumper/|/Data/|' -e 's|/lib/|/|' \
129 -e 's|/|::|g' -e 's|.pm|.3|' -e 's|.pod|.3|'`;\
130 i=`echo $$i | sed -e 's|./||'` ;\
131 echo Manifying $$j ;\
132 miniperl -I${.OBJDIR}/lib ${.OBJDIR}/pod2man $$i > ../lib/$$j ;\
133 gzip -fn ../lib/$$j ;\
140 .for I in ${DYNAMIC_EXT}
141 cd ${.OBJDIR}/ext/${I:H} ;\
143 INSTALLPRIVLIB=${DESTDIR}/usr/libdata/perl/5.00503 \
144 INSTALLARCHLIB=${DESTDIR}/usr/libdata/perl/5.00503/mach
147 for i in `find . \! -type d \! -name \*.3.gz` ; do \
148 j=`echo $$i|sed -e 's|auto/DynaLoader|mach/auto/DynaLoader|'` ;\
149 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
150 $$i ${DESTDIR}/usr/libdata/perl/5.00503/$$j ;\
153 ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
154 *.3.gz ${DESTDIR}/usr/share/perl/man/man3
156 ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
157 *.h ${DESTDIR}/usr/libdata/perl/5.00503/mach/CORE
159 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
160 Config.pm ${DESTDIR}/usr/libdata/perl/5.00503/mach