home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / bin / startup / startup.mk < prev   
Encoding:
Text File  |  1997-08-10  |  6.1 KB  |  213 lines

  1. # This is the root DMAKE startup file.
  2. #
  3. # Definitions common to all environments are given at the root.
  4. # Definitions parameterized at the root have their parameters specified
  5. # in sub-makefiles which are included based on the values of the three
  6. # make variables:
  7. #
  8. #    OS        - core operating system flavour
  9. #    OSRELEASE    - specific release of the operating system
  10. #    OSENVIRONMENT    - software construction environment in use
  11. # See the file 'summary', found in this directory for a list of
  12. # environments supported by this release.
  13.  
  14. # Disable warnings for macros given on the command line but redefined here.
  15. __.silent !:= $(.SILENT)    # Preserve user's .SILENT flag
  16. .SILENT   !:= yes
  17.  
  18. # startup.mk configuration parameters, for each, set it to non-null if you wish
  19. # to enable the named facility.
  20. __.HAVE_RCS  !:=         # yes => RCS  is installed.
  21. __.HAVE_SCCS !:=            # yes => SCCS is installed.
  22. __.DEFAULTS  !:= yes        # yes => define default construction rules.
  23. __.EXECS     !:= yes            # yes => define how to build executables.
  24.  
  25. # Grab key definitions from the environment
  26. # OS is set by default on some Win32 OSes to a long name, so
  27. # we let config.mk provide the default
  28. #.IMPORT .IGNORE : OS OSRELEASE OSENVIRONMENT TMPDIR SHELL
  29. .IMPORT .IGNORE : OSRELEASE OSENVIRONMENT TMPDIR SHELL
  30.  
  31. # Default DMAKE configuration, if not overriden by environment
  32. .INCLUDE .NOINFER $(!null,$(OS) .IGNORE) : $(INCFILENAME:d)config.mk
  33.  
  34. # Look for a local defaults configuration
  35. .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)local.mk
  36.  
  37. # Define the directory separator string.
  38. / *=  $(DIRSEPSTR)
  39.  
  40. # Customize macro definitions based on setings of OS, OSRELEASE and
  41. # OSENVIRONMENT, this must come before the default macro definitions which
  42. # follow.
  43. .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OS)$/macros.mk
  44.  
  45. # ----------------- Default Control Macro definitions -----------------------
  46. # Select appropriate defaults for basic macros
  47.    MAKE          *=  $(MAKECMD) -S $(MFLAGS)
  48.    TMPDIR        *:= $/tmp
  49.    DIVFILE       *=  $(TMPFILE)
  50.    AUGMAKE       *:= no
  51.  
  52. # Recipe execution configuration
  53.    SHELL     *:= $/bin$/sh
  54.    SHELLFLAGS     *:= -ce
  55.    GROUPSHELL     *:= $(SHELL)
  56.    GROUPFLAGS     *:= 
  57.    SHELLMETAS     *:= |();&<>?*][$$:\\#`'"
  58.    GROUPSUFFIX     *:=
  59.  
  60. # Intermediate target removal configuration
  61.    RM            *:= $/bin$/rm
  62.    RMFLAGS       *=  -f
  63.    RMTARGET      *=  $<
  64.  
  65. # Default recipe that is used to remove intermediate targets.
  66. .REMOVE :; # $(RM) $(RMFLAGS) $(RMTARGET)
  67.  
  68. # Check and enable AUGMAKE extensions for SYSV compatibility
  69. .IF $(AUGMAKE)
  70.    "@B" != $(@:b)
  71.    "@D" != $(@:d)
  72.    "@F" != $(@:f)
  73.    "*B" != $(*:b)
  74.    "*D" != $(*:d)
  75.    "*F" != $(*:f)
  76.    "<B" != $(<:b)
  77.    "<D" != $(<:d)
  78.    "<F" != $(<:f)
  79.    "?B" != $(?:b)
  80.    "?F" != $(?:f)
  81.    "?D" != $(?:d)
  82. .ENDIF
  83.  
  84. # Directory caching configuration.
  85.   .DIRCACHE         *:= yes
  86.   .DIRCACHERESPCASE *:= yes
  87.  
  88. # Define the special NULL Prerequisite
  89. NULLPRQ *:= __.NULLPRQ
  90.  
  91. # ---------- Default Construction Macro and Rule definitions --------------
  92. # The construction rules may be customized further in subsequent recipes.mk
  93. # files.
  94. .IF $(__.DEFAULTS)
  95.    # Primary suffixes in common use
  96.    A          *:= .a        # Libraries
  97.    E          *:=         # Executables
  98.    F          *:= .f        # Fortran
  99.    O          *:= .o        # Objects
  100.    P          *:= .p        # Pascal
  101.    S          *:= .s        # Assembler sources
  102.    V          *:= ,v        # RCS suffix
  103.    YTAB          *:= y.tab        # name-stem for yacc output files.
  104.    LEXYY      *:= lex.yy    # lex output file
  105.  
  106.    # Standard C-language command names and flags
  107.    CPP          *:= $/lib$/cpp    # C-preprocessor
  108.    CC         *:= cc        # C   compiler 
  109.    CFLAGS     *=        # C   compiler flags
  110.    "C++"      *:= CC        # C++ Compiler
  111.    "C++FLAGS" *=                # C++ Compiler flags
  112.  
  113.    AS         *:= as        # Assembler and flags
  114.    ASFLAGS    *= 
  115.  
  116.    LD         *= $(CC)        # Loader and flags
  117.    LDFLAGS    *=
  118.    LDLIBS     *=        # Default libraries
  119.  
  120.    AR         *:= ar        # archiver
  121.    ARFLAGS    *= -rv
  122.  
  123.    # Definition of Print command for this system.
  124.    PRINT      *= lp
  125.  
  126.    # Language and Parser generation Tools and their flags
  127.    YACC          *:= yacc        # standard yacc
  128.    YFLAGS     *=
  129.    LEX          *:= lex        # standard lex
  130.    LFLAGS     *=
  131.  
  132.    # Other Compilers, Tools and their flags
  133.    PC          *:= pc        # pascal compiler
  134.    RC          *:= f77        # ratfor compiler
  135.    FC          *:= f77        # fortran compiler
  136.    MV          *:= $/bin$/mv     # File rename command
  137.  
  138.    # Implicit generation rules for making inferences.
  139.    # lex and yacc rules
  140.    %.c : %.y %.Y
  141.     $(YACC) $(YFLAGS) $<
  142.     $(MV) $(YTAB).c $@
  143.  
  144.    %.c : %.l %.L
  145.     $(LEX) $(LFLAGS) $<
  146.     $(MV) $(LEXYY).c $@
  147.  
  148.    # Rules for making *$O
  149.    %$O : %.c ; $(CC) $(CFLAGS) -c $<
  150.    %$O : %$P ; $(PC) $(PFLAGS) -c $<
  151.    %$O : %$S ; $(AS) $(ASFLAGS) -o $@ $<
  152.    %$O : %.cl ; class -c $<
  153.    %$O :| %.e %.r %.F %$F
  154.     $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  155.  
  156.    # Defibe how to build simple executables
  157.    .IF $(__.EXECS)
  158.       %$E : %$O ; $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
  159.    .ENDIF
  160.  
  161.    # Recipe to make archive files, defined only if we have
  162.    # an archiver defined.
  163.    .IF $(AR)
  164.       %$A .SWAP .GROUP :
  165.     $(AR) $(ARFLAGS) $@ $?
  166.     $(RM) $(RMFLAGS) $?
  167.    .ENDIF
  168.  
  169.    # RCS support
  170.    .IF $(__.HAVE_RCS)
  171.       CO      *:= co        # check out for RCS
  172.       COFLAGS !+= -q
  173.  
  174.       % : $$(@:d)RCS$$/$$(@:f)$V
  175.     -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
  176.       .NOINFER : $$(@:d)RCS$$/$$(@:f)$V
  177.  
  178.       .IF $V
  179.          % : %$V
  180.         -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
  181.          .NOINFER : %$V
  182.       .ENDIF
  183.    .END
  184.  
  185.    # SCCS support
  186.    .IF $(__.HAVE_SCCS)
  187.       GET     *:= get
  188.       GFLAGS  !+=
  189.  
  190.       % : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
  191.     -$(GET) $(GFLAGS) $@
  192.       .NOINFER : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
  193.    .END
  194.  
  195.    # Customize default recipe definitions for OS, OSRELEASE, etc. settings.
  196.    .INCLUDE .NOINFER .IGNORE: $(INCFILENAME:d)$(OS)$/recipes.mk
  197. .ENDIF
  198.  
  199.  
  200. # Finally, define the default construction strategy
  201. .ROOT .PHONY .NOSTATE .SEQUENTIAL :- .INIT .TARGETS .DONE;
  202. .INIT .DONE .PHONY: $(NULLPRQ);
  203.  
  204. # Define the NULL Prerequisite as having no recipe.
  205. $(NULLPRQ) .PHONY :;
  206.  
  207. # Reset warnings back to previous setting.
  208. .SILENT !:= $(__.silent)
  209.  
  210. # Check for a Local project file, gets parsed before user makefile.
  211. .INCLUDE .IGNORE .NOINFER: "project.mk"
  212.