home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / perl / Perl / Makefile < prev    next >
Makefile  |  1995-12-06  |  10KB  |  328 lines

  1. # Makefile.SH
  2. # This file is derived from Makefile.SH.  Any changes made here will
  3. # be lost the next time you run Configure.
  4. #  Makefile is used to generate makefile.  The only difference
  5. #  is that makefile has the dependencies filled in at the end.
  6. #
  7. #
  8. # I now supply perly.c with the kits, so don't remake perly.c without byacc
  9. BYACC = byacc
  10. CC = cc
  11. LD = cc
  12.  
  13. LDFLAGS = -dynamic -prebind
  14. CLDFLAGS = -dynamic -prebind
  15.  
  16. SMALL = 
  17. LARGE =  
  18. MAB = -arch m68k -arch i386 -arch hppa -arch sparc
  19. mallocsrc = 
  20. mallocobj = 
  21. LNS = /bin/ln -s
  22. RMS = rm -f
  23. ranlib = sleep 5; /bin/ranlib
  24.  
  25. # The following are mentioned only to make metaconfig include the
  26. # appropriate questions in Configure.  If you want to change these,
  27. # edit config.sh instead, or specify --man1dir=/wherever on 
  28. # installman commandline.
  29. bin = /usr/bin
  30. scriptdir = /usr/bin
  31. privlib = /usr/lib/perl5
  32. shrpdir = /usr/lib/perl5/CORE
  33. man1dir = /usr/man/man1
  34. man1ext = 1
  35. man3dir = /usr/lib/perl5/man/man3
  36. man3ext = 3
  37.  
  38. # The following are used to build and install shared libraries for
  39. # dynamic loading.
  40. LDDLFLAGS = -dynamic -bundle -undefined suppress
  41. CCDLFLAGS =  
  42. DLSUFFIX = .bundle
  43. PLDLFLAGS =  
  44. PLIBSUF = .5.dylib
  45. SHRPENV = 
  46.  
  47. dynamic_ext =   lib/auto/Fcntl/Fcntl.bundle lib/auto/NDBM_File/NDBM_File.bundle lib/auto/ODBM_File/ODBM_File.bundle lib/auto/SDBM_File/SDBM_File.bundle lib/auto/Socket/Socket.bundle
  48. static_ext =  
  49. ext = $(dynamic_ext) $(static_ext)
  50. static_ext_autoinit =  
  51. DYNALOADER = lib/auto/DynaLoader/DynaLoader.a
  52.  
  53.  
  54. libs =   
  55.  
  56. public = perl 
  57.  
  58. shellflags = 
  59.  
  60. ## To use an alternate make, set $altmake in config.sh.
  61. MAKE = gnumake
  62.  
  63. CCCMD = `sh $(shellflags) cflags $(perllib) $@`
  64.  
  65. private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
  66.  
  67. sh = Makefile.SH c2ph.SH cflags.SH config_h.SH h2ph.SH h2xs.SH makeaperl.SH \
  68.     makedepend.SH makedir.SH perl_exp.SH perldoc.SH writemain.SH
  69.  
  70. addedbyconf = UU Makefile c2ph cflags config.h h2ph h2xs makeaperl \
  71.     makedepend makedir perl_exp perldoc writemain
  72.  
  73. h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
  74. h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
  75. h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
  76. h4 = regexp.h scope.h sv.h unixish.h util.h
  77. h = $(h1) $(h2) $(h3) $(h4)
  78.  
  79. c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
  80. c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c
  81. c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c globals.c
  82.  
  83. c = $(c1) $(c2) $(c3) miniperlmain.c perlmain.c
  84.  
  85. obj1 = $(mallocobj) gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o
  86. obj2 = hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
  87. obj3 = doop.o doio.o regexec.o taint.o deb.o globals.o
  88.  
  89. obj = $(obj1) $(obj2) $(obj3)
  90.  
  91. # Once perl has been Configure'd and built ok you build different
  92. # perl variants (Debugging, Embedded, Multiplicity etc) by saying:
  93. #    make clean; make perllib=libperl<type>.a
  94. # where <type> is some combination of 'd' and(or) 'e' or 'm'.
  95. # See cflags to understand how this works.
  96. #
  97. # Eventually some form of 'make-a-perl' script will automate this
  98. # together with linking a perl executable with any desired
  99. # static modules.
  100. perllib = libperl$(PLIBSUF)
  101.  
  102. lintflags = -hbvxac
  103.  
  104. # grrr
  105. SHELL = /bin/sh
  106.  
  107. .c.o:
  108.     $(CCCMD) $(MAB) $(PLDLFLAGS) $*.c
  109.  
  110. all: makefile miniperl $(private) $(public) $(dynamic_ext)
  111.     @echo " "; echo "    Making x2p stuff"; cd x2p; $(MAKE) all
  112.     
  113. # This is now done by installman only if you actually want the man pages.
  114. #    @echo " "; echo "    Making docs"; cd pod; $(MAKE) all;
  115.  
  116. # Phony target to force checking subdirectories.
  117. # Apparently some makes require an action for the FORCE target.
  118. FORCE:
  119.     @true
  120.  
  121. # The $& notation tells Sequent machines that it can do a parallel make,
  122. # and is harmless otherwise.
  123.  
  124. miniperl: $& miniperlmain.o $(perllib)
  125.     $(CC) $(LARGE) $(MAB) $(CLDFLAGS) -o miniperl miniperlmain.o $(perllib) $(libs)
  126.  
  127. miniperlmain.o: miniperlmain.c
  128.     $(CCCMD) $(MAB) $(PLDLFLAGS) $*.c
  129.  
  130. perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit)
  131.     sh writemain $(DYNALOADER) $(static_ext) > tmp
  132.     sh mv-if-diff tmp perlmain.c
  133.  
  134. perlmain.o: perlmain.c
  135.     $(CCCMD) $(MAB) $(PLDLFLAGS) $*.c
  136.  
  137. # The file ext.libs is a list of libraries that must be linked in
  138. # for static extensions, e.g. -lm -lgdbm, etc.  The individual
  139. # static extension Makefile's add to it.
  140. ext.libs: $(static_ext)
  141.     -@test -f ext.libs || touch ext.libs
  142.  
  143. perl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  144.     $(SHRPENV) $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain.o $(DYNALOADER) $(static_ext) $(perllib) `cat ext.libs` $(libs)
  145.  
  146. pureperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  147.     purify $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain.o $(DYNALOADER) $(static_ext) $(perllib) `cat ext.libs` $(libs)
  148.  
  149. quantperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  150.     quantify $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain.o $(DYNALOADER) $(static_ext) $(perllib) `cat ext.libs` $(libs)
  151.  
  152. $(perllib): $& perl.o $(obj)
  153.     version=1; \
  154.     libtool -dynamic -undefined warning -framework System \
  155.         -compatibility_version 1 -current_version $$version \
  156.         -prebind -seg1addr 0x27000000 -install_name $(shrpdir)/$@ \
  157.         -o $@ perl.o $(obj)
  158.  
  159. # This version, if specified in Configure, does ONLY those scripts which need
  160. # set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
  161. # checks as well as the special code to validate that the script in question
  162. # has been invoked correctly.
  163.  
  164. suidperl: $& sperl.o perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  165.     $(CC) $(LARGE) $(MAB) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain.o sperl.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
  166.  
  167. sperl.o: perl.c perly.h patchlevel.h $(h)
  168.     $(RMS) sperl.c
  169.     $(LNS) perl.c sperl.c
  170.     $(CCCMD) $(MAB) -DIAMSUID sperl.c
  171.     $(RMS) sperl.c
  172.  
  173. # We have to call our ./makedir because Ultrix 4.3 make can't handle the line
  174. #    test -d lib/auto || mkdir lib/auto
  175. #
  176. preplibrary: miniperl lib/Config.pm
  177.     @./makedir lib/auto
  178.     @echo "    AutoSplitting perl library"
  179.     @./miniperl -Ilib -e 'use AutoSplit; \
  180.         autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
  181.  
  182. # Take care to avoid modifying lib/Config.pm without reason
  183. lib/Config.pm: config.sh miniperl
  184.     ./miniperl configpm tmp
  185.     sh mv-if-diff tmp lib/Config.pm
  186.  
  187. lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.PL lib/Config.pm
  188.     ./miniperl minimod.PL > tmp && mv tmp $@
  189.  
  190. install: all install.perl install.man
  191.  
  192. install.perl:    all
  193.     ./perl installperl
  194.  
  195. install.man:    all
  196.     ./perl installman
  197.  
  198. # Not implemented yet.
  199. #install.html:    all
  200. #    ./perl installhtml
  201.  
  202. # I now supply perly.c with the kits, so the following section is
  203. # used only if you force byacc to run by saying
  204. #     make run_byacc
  205. # Since we patch up the byacc output, the perly.fixer script needs
  206. # to run with precisely the same version of byacc as I use.  You
  207. # normally shouldn't remake perly.[ch].
  208.  
  209. run_byacc:    FORCE
  210.     @ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
  211.     $(BYACC) -d perly.y
  212.     sh $(shellflags) ./perly.fixer y.tab.c perly.c
  213.     mv y.tab.h perly.h
  214.     echo 'extern YYSTYPE yylval;' >>perly.h
  215.  
  216. # We don't want to regenerate perly.c and perly.h, but they might
  217. # appear out-of-date after a patch is applied or a new distribution is
  218. # made.
  219. perly.c: perly.y
  220.     -@touch perly.c
  221.  
  222. perly.h: perly.y
  223.     -@touch perly.h
  224.  
  225. # The following three header files are generated automatically
  226. #    keywords.h:    keywords.pl
  227. #    opcode.h:    opcode.pl
  228. #    embed.h:      embed.pl global.sym interp.sym
  229. # The correct versions should be already supplied with the perl kit,
  230. # in case you don't have perl available.
  231. # To force them to run, type
  232. #    make regen_headers
  233. regen_headers:    FORCE
  234.     perl keywords.pl
  235.     perl opcode.pl
  236.     perl embed.pl
  237.  
  238. # Extensions:
  239. # Names added to $(dynamic_ext) or $(static_ext) will automatically
  240. # get built.  There should ordinarily be no need to change any of
  241. # this part of makefile.
  242. #
  243. # The dummy dependency is a place holder in case $(dynamic_ext) or
  244. # $(static_ext) is empty.
  245. #
  246. # DynaLoader may be needed for extensions that use Makefile.PL.
  247.  
  248. $(DYNALOADER):    miniperl preplibrary FORCE
  249.     @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
  250.  
  251. d_dummy $(dynamic_ext):    miniperl preplibrary $(DYNALOADER) FORCE
  252.     @sh ext/util/make_ext dynamic $@ LIBPERL_A=$(perllib)
  253.  
  254. s_dummy $(static_ext):    miniperl preplibrary $(DYNALOADER) FORCE
  255.     @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
  256.  
  257. clean:
  258.     rm -f *.o *.a all perlmain.c
  259.     rm -f perl.exp ext.libs
  260.     -cd x2p; $(MAKE) clean
  261.     -cd pod; $(MAKE) clean
  262.     -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
  263.     sh ext/util/make_ext clean $$x ; \
  264.     done
  265.     rm -f perl suidperl miniperl $(perllib)
  266.  
  267. realclean: clean
  268.     -cd x2p; $(MAKE) realclean
  269.     -cd pod; $(MAKE) realclean
  270.     @for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
  271.     sh ext/util/make_ext realclean $$x ; \
  272.     done
  273.     rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
  274.     rm -rf $(addedbyconf)
  275.     rm -f makefile makefile.old
  276.     rm -f $(private)
  277.     rm -rf lib/auto
  278.     rm -f lib/.exists
  279.     rm -f h2ph.man pstruct
  280.     rm -rf .config
  281.     @echo "Note that make realclean does not delete config.sh"
  282.  
  283. clobber:    realclean
  284.     rm -f config.sh cppstdin
  285.  
  286. distclean:    clobber
  287.  
  288. # The following lint has practically everything turned on.  Unfortunately,
  289. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  290. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  291. # for that spot.
  292.  
  293. lint: perly.c $(c)
  294.     lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
  295.  
  296. makefile:    Makefile
  297.     $(MAKE) depend
  298.  
  299. config.h: config.sh
  300.     /bin/sh config_h.SH
  301.  
  302. # When done, touch perlmain.c so that it doesn't get remade each time.
  303. depend: makedepend
  304.     ./makedepend
  305.     - test -s perlmain.c && touch perlmain.c
  306.     cd x2p; $(MAKE) depend
  307.  
  308. test: miniperl perl preplibrary $(dynamic_ext)
  309.     - cd t && chmod +x TEST */*.t
  310.     - cd t && (rm -f perl; $(LNS) ../perl perl) && ./perl TEST </dev/tty
  311.  
  312. minitest: miniperl
  313.     - cd t && chmod +x TEST */*.t
  314.     - cd t && (rm -f perl; $(LNS) ../miniperl perl) \
  315.         && ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t </dev/tty
  316.  
  317. clist:    $(c)
  318.     echo $(c) | tr ' ' '\012' >.clist
  319.  
  320. hlist:  $(h)
  321.     echo $(h) | tr ' ' '\012' >.hlist
  322.  
  323. shlist: $(sh)
  324.     echo $(sh) | tr ' ' '\012' >.shlist
  325.  
  326. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  327. # If this runs make out of memory, delete /usr/include lines.
  328.