home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / gcc / ixemulsrc.lha / ixemul / Makefile.in < prev    next >
Makefile  |  1996-12-11  |  15KB  |  442 lines

  1. #### Start of system configuration section. ####
  2.  
  3. srcdir =    @srcdir@
  4. VPATH =        @srcdir@
  5.  
  6. # Common prefix for machine-independent installed files.
  7. prefix =    @prefix@
  8.  
  9. # Common prefix for machine-dependent installed files.
  10. exec_prefix =    @exec_prefix@
  11.  
  12. bindir =    $(exec_prefix)/bin
  13. libdir =    $(exec_prefix)/lib
  14. syslibsdir =    $(exec_prefix)/Sys/libs
  15. sysldir =    $(exec_prefix)/Sys/l
  16. incdir =    $(exec_prefix)/include
  17. etcdir =    $(exec_prefix)/etc
  18. mandir =    $(prefix)/man
  19.  
  20. INSTALL =    @INSTALL@
  21. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  22. INSTALL_DATA =    @INSTALL_DATA@
  23.  
  24. CC =        @CC@
  25. AS =        as
  26. CFLAGS =    @CFLAGS@
  27. LDFLAGS =    @LDFLAGS@
  28.  
  29. RANLIB =    @RANLIB@
  30.  
  31. #### End system configuration section ####
  32.  
  33. # Directories that depend on baserel/baserel32/no-baserel only
  34. BASE =        glue stack static net db
  35.  
  36.  
  37. # Directories that depend on the CPU type
  38. CPUONLY =    ixnet
  39.  
  40.  
  41. # Directories that depend on the CPU and FPU type
  42. CPUFPU =    general string stdlib stdio library
  43.  
  44.  
  45. # Directories that depend on both baserel/baserel32/no-baserel and CPU/FPU type
  46. # None at the moment, although 'stack' and 'static' should be moved here
  47. # once we can use a CPU/FPU specific libc.a.
  48. BASECPUFPU =
  49.  
  50.  
  51. # For use in 'make clean' and 'make clobber'
  52. DIRS =        $(BASE) $(CPUONLY) $(CPUFPU) $(BASECPUFPU)
  53.  
  54.  
  55. ###  CPU-FPU types.
  56. ###
  57. ###  The default thing to do is to make all reasonable combinations of the
  58. ###  library.
  59. ###
  60. ###  Note that libsrc, which builds the runtime startup files and all
  61. ###  versions of libc.a, and utils completely ignore the base/cpu/fpu variables,
  62. ###  so these are handled in the all: target.
  63. ###
  64. ###  You can remove specific CPU/FPU combinations that you are not interested in.
  65.  
  66. CPU-FPU-TYPES =    68000.soft-float \
  67.         68020.soft-float 68020.68881 \
  68.         68040.soft-float 68040.68881
  69.  
  70. # Some additional options for OTHER_CFLAGS that may or may not be useful are:
  71. #
  72. # -DDEBUG_VERSION    (build a debugging version)
  73. # -DNOTRAP              (build a version that uses tc_UserData instead of
  74. #                        tc_TrapData and also doesn't install any traphandlers.
  75. #                        This can be used for debugging with a debugger other
  76. #                        than gdb.
  77.  
  78. OTHER_CFLAGS = -static -fomit-frame-pointer -Wall
  79.  
  80.  
  81. ###############################################
  82. ###                                         ###
  83. ###  DO NOT EDIT ANYTHING BELOW THIS LINE!  ###
  84. ###                                         ###
  85. ###############################################
  86.  
  87. ### All targets that are generated look like this:
  88. ###
  89. ###     directory-name.cpu.fpu.base
  90. ###
  91. ### The following four defines extract one of these fields from the target name:
  92.  
  93. dir  = $(word 1, $(subst ., ,$@))
  94. cpu  = $(word 2, $(subst ., ,$@))
  95. fpu  = $(word 3, $(subst ., ,$@))
  96. base = $(word 4, $(subst ., ,$@))
  97.  
  98.  
  99. FLAGS_TO_PASS =    "AS=$(AS)"            \
  100.         "BASE=$(base)"            \
  101.         "BUILDDIR=$(dir)"        \
  102.         "CC=$(CC)"            \
  103.         "CFLAGS=$(CFLAGS)"        \
  104.         "CPU=$(cpu)"            \
  105.         "FPU=$(fpu)"            \
  106.         "LDFLAGS=$(LDFLAGS)"        \
  107.         "OTHER_CFLAGS=$(OTHER_CFLAGS)"    \
  108.         "RANLIB=$(RANLIB)"
  109.  
  110. ### Generate the targets we have to build. First we create defines for each
  111. ### type (dependent on base only, or only on cpu-fpu, or dependent on all
  112. ### three). Only the directory needs to be filled in in the second stage.
  113.  
  114. base-types         = $(d).68000.soft-float.baserel \
  115.              $(d).68020.soft-float.baserel32 \
  116.              $(d).68000.soft-float.no-baserel
  117.  
  118. cpu-types       = $(addprefix $(d).,$(sort $(CPU-FPU-TYPES:.68881=.soft-float)))
  119.  
  120. cpu-fpu-types      = $(addprefix $(d).,$(CPU-FPU-TYPES))
  121.  
  122. base-cpu-fpu-types = $(addsuffix .baserel, $(cpu-fpu-types)) \
  123.              $(addsuffix .baserel32, $(cpu-fpu-types)) \
  124.              $(addsuffix .no-baserel, $(cpu-fpu-types))
  125.  
  126.  
  127. ### Now fill in the directory name
  128.  
  129. base-targets         := $(foreach d, $(BASE),       $(base-types))
  130. cpu-targets          := $(foreach d, $(CPUONLY),    $(cpu-types))
  131. cpu-fpu-targets      := $(foreach d, $(CPUFPU),     $(cpu-fpu-types))
  132. base-cpu-fpu-targets := $(foreach d, $(BASECPUFPU), $(base-cpu-fpu-types))
  133.  
  134.  
  135. ### Make all targets and libsrc, utils and man pages.
  136.  
  137. all:    gcc-ok $(base-targets) $(cpu-targets) $(cpu-fpu-targets) $(base-cpu-fpu-targets)
  138.     @(cd libsrc && $(MAKE) $(FLAGS_TO_PASS))
  139.     @(cd utils && $(MAKE) $(FLAGS_TO_PASS))
  140.     @(cd man && $(MAKE) $(FLAGS_TO_PASS))
  141.  
  142. gcc-ok:
  143.     @echo >t.c
  144.     @echo If the next command fails, then your gcc is out of date! 
  145.     gcc -c -m68020 -resident32 -mrestore-a4 t.c
  146.     @echo >gcc-ok
  147.     @rm -f t.c t.o
  148.  
  149. ###  Some targets are only dependent on BASE, others on CPU-FPU, and
  150. ###  others depend on all three.
  151.  
  152. ###  This makes targets that are only dependent on BASE.
  153.  
  154. $(base-targets):
  155.     @if [ ! -d $(dir)/$(base) ]; then    \
  156.         echo mkdir -p $(dir)/$(base);    \
  157.         mkdir -p $(dir)/$(base);    \
  158.     fi;                    \
  159.     (cd $(dir)/$(base) ; $(MAKE) -f ../Makefile $(FLAGS_TO_PASS));
  160.  
  161.  
  162. ###  This makes targets that are only dependent on the CPU.
  163.  
  164. $(cpu-targets):
  165.     @if [ ! -d $(dir)/$(cpu) ]; then        \
  166.         echo mkdir -p $(dir)/$(cpu);        \
  167.         mkdir -p $(dir)/$(cpu);            \
  168.     fi;                        \
  169.     (cd $(dir)/$(cpu) ; $(MAKE) -f ../Makefile $(FLAGS_TO_PASS))
  170.  
  171.  
  172. ###  This makes targets that are only dependent on CPU and FPU.
  173.  
  174. $(cpu-fpu-targets):
  175.     @if [ ! -d $(dir)/$(cpu)/$(fpu) ]; then        \
  176.         echo mkdir -p $(dir)/$(cpu)/$(fpu);    \
  177.         mkdir -p $(dir)/$(cpu)/$(fpu);        \
  178.     fi;                        \
  179.     (cd $(dir)/$(cpu)/$(fpu) ; $(MAKE) -f ../../Makefile $(FLAGS_TO_PASS))
  180.  
  181.  
  182. ###  This makes targets that are dependent on CPU, FPU, and BASE.
  183.  
  184. $(base-cpu-fpu-targets):
  185.     @if [ ! -d $(dir)/$(base)/$(cpu)/$(fpu) ]; then        \
  186.         echo mkdir -p $(dir)/$(base)/$(cpu)/$(fpu);    \
  187.         mkdir -p $(dir)/$(base)/$(cpu)/$(fpu);        \
  188.     fi;                            \
  189.     (cd $(dir)/$(base)/$(cpu)/$(fpu) ; $(MAKE) -f ../../../Makefile $(FLAGS_TO_PASS));
  190.  
  191.  
  192. ###  Install all the libraries, include files, runtime files, etc.
  193.  
  194. install: installdirs
  195.     if [ -f library/68000/soft-float/ixemul.library ] ; then \
  196.         $(INSTALL) library/68000/soft-float/ixemul.library \
  197.             $(syslibsdir)/ixemul.library; \
  198.     else true; fi
  199.     if [ -f library/68000/soft-float/ixemul.trace ] ; then \
  200.         $(INSTALL) library/68000/soft-float/ixemul.trace \
  201.             $(syslibsdir)/ixemul.trace; \
  202.     else true; fi
  203.     if [ -f library/68000/soft-float/ixemul.library ] ; then \
  204.         $(INSTALL) library/68000/soft-float/ixemul.library \
  205.             $(syslibsdir)/ixemul000.library; \
  206.     else true; fi
  207.     if [ -f library/68000/soft-float/ixemul.trace ] ; then \
  208.         $(INSTALL) library/68000/soft-float/ixemul.trace \
  209.             $(syslibsdir)/ixemul000.trace; \
  210.     else true; fi
  211.     if [ -f library/68020/soft-float/ixemul.library ] ; then \
  212.         $(INSTALL) library/68020/soft-float/ixemul.library \
  213.             $(syslibsdir)/ixemul020.library; \
  214.     else true; fi
  215.     if [ -f library/68020/soft-float/ixemul.trace ] ; then \
  216.         $(INSTALL) library/68020/soft-float/ixemul.trace \
  217.             $(syslibsdir)/ixemul020.trace; \
  218.     else true; fi
  219.     if [ -f library/68040/soft-float/ixemul.library ] ; then \
  220.         $(INSTALL) library/68040/soft-float/ixemul.library \
  221.             $(syslibsdir)/ixemul040.library; \
  222.     else true; fi
  223.     if [ -f library/68040/soft-float/ixemul.trace ] ; then \
  224.         $(INSTALL) library/68040/soft-float/ixemul.trace \
  225.             $(syslibsdir)/ixemul040.trace; \
  226.     else true; fi
  227.     if [ -f library/68020/68881/ixemul.library ] ; then \
  228.         $(INSTALL) library/68020/68881/ixemul.library \
  229.             $(syslibsdir)/ixemul020fpu.library; \
  230.     else true; fi
  231.     if [ -f library/68020/68881/ixemul.trace ] ; then \
  232.         $(INSTALL) library/68020/68881/ixemul.trace \
  233.             $(syslibsdir)/ixemul020fpu.trace; \
  234.     else true; fi
  235.     if [ -f library/68040/68881/ixemul.library ] ; then \
  236.         $(INSTALL) library/68040/68881/ixemul.library \
  237.             $(syslibsdir)/ixemul040fpu.library; \
  238.     else true; fi
  239.     if [ -f library/68040/68881/ixemul.trace ] ; then \
  240.         $(INSTALL) library/68040/68881/ixemul.trace \
  241.             $(syslibsdir)/ixemul040fpu.trace; \
  242.     else true; fi
  243.     if [ -f library/68060/68881/ixemul.library ] ; then \
  244.         $(INSTALL) library/68060/68881/ixemul.library \
  245.             $(syslibsdir)/ixemul060fpu.library; \
  246.     else true; fi
  247.     if [ -f library/68060/68881/ixemul.trace ] ; then \
  248.         $(INSTALL) library/68060/68881/ixemul.trace \
  249.             $(syslibsdir)/ixemul060fpu.trace; \
  250.     else true; fi
  251.  
  252.     if [ -f ixnet/68000/ixnet.library ] ; then \
  253.         $(INSTALL) ixnet/68000/ixnet.library \
  254.             $(syslibsdir)/ixnet.library; \
  255.     else true; fi
  256.     if [ -f ixnet/68000/ixnet.library ] ; then \
  257.         $(INSTALL) ixnet/68000/ixnet.library \
  258.             $(syslibsdir)/ixnet000.library; \
  259.     else true; fi
  260.     if [ -f ixnet/68020/ixnet.library ] ; then \
  261.         $(INSTALL) ixnet/68020/ixnet.library \
  262.             $(syslibsdir)/ixnet020.library; \
  263.     else true; fi
  264.     if [ -f ixnet/68040/ixnet.library ] ; then \
  265.         $(INSTALL) ixnet/68040/ixnet.library \
  266.             $(syslibsdir)/ixnet040.library; \
  267.     else true; fi
  268.     if [ -f ixnet/68060/ixnet.library ] ; then \
  269.         $(INSTALL) ixnet/68060/ixnet.library \
  270.             $(syslibsdir)/ixnet060.library; \
  271.     else true; fi
  272.  
  273.     $(INSTALL) libsrc/crt0.o $(libdir)/crt0.o
  274.     $(INSTALL) libsrc/bcrt0.o $(libdir)/bcrt0.o
  275.     $(INSTALL) libsrc/gcrt0.o $(libdir)/gcrt0.o
  276.     $(INSTALL) libsrc/mcrt0.o $(libdir)/mcrt0.o
  277.     $(INSTALL) libsrc/rcrt0.o $(libdir)/rcrt0.o
  278.     $(INSTALL) libsrc/scrt0.o $(libdir)/scrt0.o
  279.     $(INSTALL) libsrc/lcrt0.o $(libdir)/lcrt0.o
  280.     $(INSTALL) libsrc/libc.a $(libdir)/libc.a
  281.     $(INSTALL) libsrc/libbc.a $(libdir)/libb/libc.a
  282.     $(INSTALL) libsrc/libb32c.a $(libdir)/libb32/libc.a
  283.     $(INSTALL) libsrc/libc_p.a $(libdir)/libc_p.a
  284.     $(INSTALL_PROGRAM) utils/ixtrace $(bindir)/ixtrace
  285.     $(INSTALL_PROGRAM) utils/ixprefs $(bindir)/ixprefs
  286.     $(INSTALL_PROGRAM) utils/ixtimezone $(bindir)/ixtimezone
  287.     $(INSTALL_PROGRAM) utils/ixrun $(bindir)/ixrun
  288.     $(INSTALL_PROGRAM) utils/tzselect $(bindir)/tzselect
  289.     $(INSTALL_PROGRAM) utils/ixstack $(bindir)/ixstack
  290.     $(INSTALL) utils/ixpipe-handler $(sysldir)/ixpipe-handler
  291.     (cd $(srcdir)/include && cp -r . $(incdir))
  292.     find $(incdir) -type d -name CVS -print | xargs rm -rf
  293.     (cd $(srcdir)/man && cp -r man? $(mandir))
  294.     find $(mandir) -type d -name CVS -print | xargs rm -rf
  295.     mkdir -p $(etcdir)/zoneinfo
  296.     cp $(srcdir)/utils/*.tab $(etcdir)/zoneinfo
  297.     (cd utils/zoneinfo && cp -r . $(etcdir)/zoneinfo)
  298.         
  299.  
  300. installdirs:    mkinstalldirs
  301.     $(srcdir)/mkinstalldirs $(bindir) $(libdir) $(syslibsdir) \
  302.         $(sysldir) $(incdir) $(etcdir) $(mandir) $(libdir)/libb \
  303.         $(libdir)/libb32
  304.  
  305.  
  306. clean:
  307.     @-for i in $(DIRS) libsrc utils man; \
  308.         do (cd $$i ; $(MAKE) $(FLAGS_TO_PASS) clean) ; done
  309.  
  310.  
  311. clobber:
  312.     @-for i in $(DIRS) libsrc utils man; \
  313.         do (cd $$i ; $(MAKE) $(FLAGS_TO_PASS) clobber) ; done
  314.     -rm -f Makefile config.* conftest.c gcc-ok
  315.  
  316.  
  317. # Build source and binary distribution files.
  318.  
  319. dist:
  320.     #
  321.     # First get rid of any leftovers from a previous "make dist"
  322.     #
  323.     rm -rf ade ixemul distrib
  324.     mkdir -p distrib
  325.     #
  326.     # Create ixemul-bin.lha, which contains utilities
  327.     # that are generally useful to ixemul.library users.
  328.     #
  329.     mkdir -p ade/bin ade/Sys/l ade/Sys/devs
  330.     cp -p utils/ixprefs ade/bin/ixprefs
  331.     cp -p utils/ixtrace ade/bin/ixtrace
  332.     cp -p utils/ixrun ade/bin/ixrun
  333.     cp -p utils/ixstack ade/bin/ixstack
  334.     cp -p utils/ixpipe-handler ade/Sys/l/ixpipe-handler
  335.     cp -p $(srcdir)/utils/Mountlist ade/Sys/devs/MountList.ixpipe
  336.     (cd ade && lha -mraxeq a /distrib/ixemul-bin.lha bin Sys)
  337.     sleep 5
  338.     rm -rf ade
  339.     #
  340.     # Create ixemul-tz.lha, which has timezone related pieces.
  341.     #
  342.     mkdir -p ade/etc ade/bin
  343.     cp -p utils/ixtimezone ade/bin/ixtimezone
  344.     cp -p utils/zic ade/bin/zic
  345.     cp -p utils/tzselect ade/bin/tzselect
  346.     cp -pr utils/zoneinfo ade/etc/zoneinfo
  347.     cp $(srcdir)/utils/*.tab ade/etc/zoneinfo
  348.     (cd ade && lha -mraxeq a /distrib/ixemul-tz.lha bin etc)
  349.     sleep 5
  350.     rm -rf ade
  351.     #
  352.     # Create ixemul-sdk.lha, which contains the files that
  353.     # programmers need to build applications that use ixemul.library.
  354.     #
  355.     mkdir -p ade/lib/libb
  356.     mkdir -p ade/lib/libb32
  357.     cp -p libsrc/crt0.o ade/lib/crt0.o
  358.     cp -p libsrc/bcrt0.o ade/lib/bcrt0.o
  359.     cp -p libsrc/gcrt0.o ade/lib/gcrt0.o
  360.     cp -p libsrc/mcrt0.o ade/lib/mcrt0.o
  361.     cp -p libsrc/rcrt0.o ade/lib/rcrt0.o
  362.     cp -p libsrc/lcrt0.o ade/lib/lcrt0.o
  363.     cp -p libsrc/scrt0.o ade/lib/scrt0.o
  364.     cp -p libsrc/libc.a ade/lib/libc.a
  365.     cp -p libsrc/libbc.a ade/lib/libb/libc.a
  366.     cp -p libsrc/libb32c.a ade/lib/libb32/libc.a
  367.     cp -p libsrc/libc_p.a ade/lib/libc_p.a
  368.     cp -pr $(srcdir)/include ade/include
  369.     mkdir ade/man
  370.     cp -pr man/cat? ade/man
  371.     find ade -name CVS -print | xargs rm -rf
  372.     (cd ade && lha -mraxeq a /distrib/ixemul-sdk.lha lib include man)
  373.     sleep 5
  374.     rm -rf ade
  375.     #
  376.     # Create ixemul-doc.lha, which contains various documentation
  377.     # files.
  378.     #
  379.     mkdir ixemul
  380.     cp -p $(srcdir)/COPYING ixemul/COPYING
  381.     cp -p $(srcdir)/COPYING.LIB ixemul/COPYING.LIB
  382.     cp -p $(srcdir)/INSTALL ixemul/INSTALL
  383.     cp -p $(srcdir)/NEWS ixemul/NEWS
  384.     cp -p $(srcdir)/BUGS ixemul/BUGS
  385.     cp -p $(srcdir)/TODO ixemul/TODO
  386.     cp -p $(srcdir)/README ixemul/README
  387.     cp -p $(srcdir)/utils/ixprefs.guide ixemul/ixprefs.guide
  388.     cp -p $(srcdir)/utils/ixprefs.guide.info ixemul/ixprefs.guide.info
  389.     lha -mraxeq a distrib/ixemul-doc.lha ixemul
  390.     rm -rf ixemul
  391.     #
  392.     # Create ixemul-src.tgz, which contains the source code.
  393.     # Do it in a temporary location so we don't have to
  394.     # know where the build dir is, or translate between
  395.     # Unix & AmigaOS forms.  We also delete any CVS dirs
  396.     # at this time.
  397.     #
  398.     rm -rf ixemul-src.tgz ixemul
  399.     cp -pr $(srcdir) ixemul
  400.     find ixemul -name CVS -print | xargs rm -rf
  401.     lha -mraxeq a distrib/ixemul-src.lha ixemul
  402.     rm -rf ixemul
  403.     #
  404.     # Create ixemul-<cpu><fpu>.lha
  405.     #
  406.     mkdir -p ade/Sys/libs
  407.     cp -p library/68000/soft-float/ixemul.library ade/Sys/libs/ixemul000.library
  408.     cp -p ixnet/68000/ixnet.library ade/Sys/libs/ixnet000.library
  409.     cp -p $(srcdir)/README ade/Sys/libs/README
  410.     (cd ade && lha -mraxeq a /distrib/ixemul-000s.lha Sys)
  411.     rm -f ade/Sys/libs/*
  412.     cp -p library/68000/soft-float/ixemul.trace ade/Sys/libs/ixemul000.trace
  413.     cp -p $(srcdir)/README ade/Sys/libs/README
  414.     (cd ade && lha -mraxeq a /distrib/ixemul-000t.lha Sys)
  415.     rm -f ade/Sys/libs/*
  416.     cp -p library/68020/soft-float/ixemul.library ade/Sys/libs/ixemul020.library
  417.     cp -p ixnet/68020/ixnet.library ade/Sys/libs/ixnet020.library
  418.     cp -p $(srcdir)/README ade/Sys/libs/README
  419.     (cd ade && lha -mraxeq a /distrib/ixemul-020s.lha Sys)
  420.     rm -f ade/Sys/libs/*
  421.     cp -p library/68040/soft-float/ixemul.library ade/Sys/libs/ixemul040.library
  422.     cp -p ixnet/68040/ixnet.library ade/Sys/libs/ixnet040.library
  423.     cp -p $(srcdir)/README ade/Sys/libs/README
  424.     (cd ade && lha -mraxeq a /distrib/ixemul-040s.lha Sys)
  425.     rm -f ade/Sys/libs/*
  426.     cp -p library/68020/68881/ixemul.library ade/Sys/libs/ixemul020fpu.library
  427.     cp -p ixnet/68020/ixnet.library ade/Sys/libs/ixnet020fpu.library
  428.     cp -p $(srcdir)/README ade/Sys/libs/README
  429.     (cd ade && lha -mraxeq a /distrib/ixemul-020f.lha Sys)
  430.     rm -f ade/Sys/libs/*
  431.     cp -p library/68040/68881/ixemul.library ade/Sys/libs/ixemul040fpu.library
  432.     cp -p ixnet/68040/ixnet.library ade/Sys/libs/ixnet040fpu.library
  433.     cp -p $(srcdir)/README ade/Sys/libs/README
  434.     (cd ade && lha -mraxeq a /distrib/ixemul-040f.lha Sys)
  435.     rm -f ade/Sys/libs/*
  436. #    cp -p library/68060/68881/ixemul.library ade/Sys/libs/ixemul060fpu.library
  437. #    cp -p ixnet/68060/ixnet.library ade/Sys/libs/ixnet060fpu.library
  438. #    cp -p $(srcdir)/README ade/Sys/libs/README
  439. #    (cd ade && lha -mraxeq a /distrib/ixemul-060f.lha Sys)
  440.     sleep 5
  441.     rm -rf ade
  442.