Rename .sub files back to .inc.
[dragonfly.git] / gnu / usr.bin / perl / Makefile.inc
1 # $FreeBSD: src/gnu/usr.bin/perl/Makefile.inc,v 1.12.2.5 2002/03/19 15:52:16 ru Exp $
2 # $DragonFly: src/gnu/usr.bin/perl/Attic/Makefile.inc,v 1.4 2004/01/28 21:26:51 dillon Exp $
3
4 PERL5SRC?= ${.CURDIR}/../../../../contrib/perl5
5 PERL5LIBSRC?= ${.CURDIR}/../libperl
6
7 .if exists(${.OBJDIR}/../miniperl/miniperl)
8 MINIPERL?=      ${.OBJDIR}/../miniperl/miniperl
9 .else
10 MINIPERL?=      ${.OBJDIR}/../../miniperl/miniperl
11 .endif
12
13 BINDIR?=        /usr/bin
14
15 SHLIB_MAJOR?=   3
16
17 VERSION=        5.00503
18
19 DYNALOADER= lib/auto/DynaLoader/DynaLoader.a
20
21 HEADERS=EXTERN.h INTERN.h XSUB.h XSlock.h av.h bytecode.h byterun.h \
22         cc_runtime.h cop.h cv.h dosish.h embed.h embedvar.h fakethr.h form.h \
23         gv.h handy.h hv.h intrpvar.h iperlsys.h keywords.h mg.h nostdio.h \
24         objXSUB.h objpp.h op.h opcode.h patchlevel.h perl.h perlio.h \
25         perlsdio.h perlsfio.h perlvars.h perly.h pp.h pp_proto.h proto.h \
26         regcomp.h regexp.h regnodes.h scope.h sv.h thrdvar.h thread.h \
27         unixish.h util.h
28
29 DEPEND_H=
30
31 .for I in ${HEADERS}
32 ${.OBJDIR}/${I}: ${I}
33         @ln -sf ${.OODATE} ${.TARGET}
34
35 CLEANFILES+= ${.OBJDIR}/${I}
36 DEPEND_H+= ${.OBJDIR}/${I}
37 .endfor
38
39 LDFLAGS+=       -L${.OBJDIR}/../libperl
40
41 links: ${DEPEND_H}
42         @for d in ${FARMDIRS} ; do \
43                 rm -rf $${d} ;\
44                 for i in `cd ${PERL5SRC}; find $${d} -type d -a \! -name CVS` ;\
45                 do \
46                         mkdir -p $${i} ;\
47                 done ;\
48                 for i in `cd ${PERL5SRC}; find $${d} -type f | grep -v CVS` ;\
49                 do \
50                         ln -s ${PERL5SRC}/$${i} $${i} ;\
51                 done ;\
52         done
53         @-mkdir lib/auto
54         @-mkdir build
55         @ln -sf ${PERL5SRC}/config_h.SH config_h.sh
56         @ln -sf ${PERL5SRC}/cflags.SH cflags.sh
57         @ln -sf ${PERL5SRC}/ext/re/re.pm lib/re.pm
58         @ln -sf ${PERL5SRC}/myconfig myconfig
59         @ln -sf ${PERL5SRC}/miniperlmain.c miniperlmain.c
60         @ln -sf ${PERL5SRC}/writemain.SH writemain.sh
61         @ln -sf ${PERL5SRC}/regcomp.c regcomp.c
62         @ln -sf ${PERL5SRC}/regexec.c regexec.c
63         @ln -sf ${PERL5LIBSRC}/config.SH-${OBJFORMAT}.${MACHINE_ARCH} \
64                 config.sh
65         @touch ${.TARGET}
66
67 scripts: links
68         @sh config_h.sh
69         @sh cflags.sh
70         @sh writemain.sh
71         @${MINIPERL} ${PERL5SRC}/configpm \
72                 Config.pm Porting/Glossary myconfig
73         @ln -sf ../Config.pm lib/Config.pm
74         @touch ${.TARGET}
75
76 .if !defined(NO_PERL_SCRIPT_MAKE)
77 config.h:       scripts
78 .endif
79
80 CLEANFILES+=    links scripts
81 CLEANFILES+=    config.h config.sh config_h.sh Config.pm
82 CLEANFILES+=    regcomp.c regexec.c miniperlmain.c
83 CLEANFILES+=    writemain writemain.sh cflags cflags.sh myconfig
84 CLEANDIRS+=     lib ext Porting hints build
85
86 FARMDIRS=       lib ext Porting hints
87
88 MAKEMAKER_ARGS= INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
89                 INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3 \
90                 PERL=${MINIPERL} FULLPERL=perl DEFINE=-I${DESTDIR}/usr/include \
91                 DEFINE=-DPERL_CORE
92
93 .if defined(PERL_DEBUGGING) && ${PERL_DEBUGGING} == "true"
94 CFLAGS+=        -DDEBUGGING
95 .endif
96
97 autosplit: scripts lib/*.pm lib/*/*.pm
98         ${MINIPERL} -I${.OBJDIR}/lib \
99                 -e 'use AutoSplit; autosplit_lib_modules(@ARGV)' \
100                 lib/*.pm lib/*/*.pm
101         @touch ${.TARGET}
102
103 ${DYNALOADER}:  scripts \
104                 ext/DynaLoader/DynaLoader.pm \
105                 ext/DynaLoader/Makefile
106         @cd ext/DynaLoader; \
107         make -B all PERL_SRC=${.OBJDIR}
108
109 ext/DynaLoader/DynaLoader.pm: scripts ext/DynaLoader/DynaLoader_pm.PL
110         @cd ext/DynaLoader; \
111         ${MINIPERL} -I${.OBJDIR} -I${.OBJDIR}/lib DynaLoader_pm.PL DynaLoader.pm
112
113 ext/DynaLoader/XSLoader.pm: scripts ext/DynaLoader/XSLoader_pm.PL
114         @cd ext/DynaLoader; \
115         ${MINIPERL} -I${.OBJDIR} -I${.OBJDIR}/lib XSLoader_pm.PL XSLoader.pm
116
117 ext/DynaLoader/Makefile: scripts ext/DynaLoader/Makefile.PL
118         @cd ext/DynaLoader; \
119         ${MINIPERL} -I${.OBJDIR} -I${.OBJDIR}/lib Makefile.PL ${MAKEMAKER_ARGS} \
120                 LINKTYPE=static LIBS="-lperl -lm"; \
121         make -B config PERL_SRC=${.OBJDIR}