home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / DMAKE35X.ZIP / STARTUP.MK < prev   
Text File  |  1990-08-15  |  4KB  |  151 lines

  1. # MSDOS DMAKE startup file.  Customize to suit your needs.
  2. # Assumes MKS toolkit for the tool commands, and Microsoft C.  Change as req'd.
  3. # See the documentation for a description of internally defined macros.
  4. #
  5. # Disable warnings for macros redefined here that were given
  6. # on the command line.
  7. __.SILENT := $(.SILENT)
  8. .SILENT   := yes
  9.  
  10. # Configuration parameters for DMAKE startup.mk file
  11. # Set these to NON-NULL if you wish to turn the parameter on.
  12. _HAVE_RCS    := yes        # yes => RCS  is installed.
  13. _HAVE_SCCS    :=         # yes => SCCS is installed.
  14.  
  15. # Applicable suffix definitions
  16. A := .lib    # Libraries
  17. E := .exe    # Executables
  18. F := .for    # Fortran
  19. O := .obj    # Objects
  20. P := .pas    # Pascal
  21. S := .asm    # Assembler sources
  22. V :=         # RCS suffix
  23.  
  24. # See if these are defined
  25. TMPDIR := $(ROOTDIR)/tmp
  26. .IMPORT .IGNORE : TMPDIR SHELL COMSPEC
  27.  
  28. # Recipe execution configurations
  29. # First set SHELL, If it is not defined, use COMSPEC, otherwise
  30. # it is assumed to be MKS Korn SHELL.
  31. .IF $(SHELL) == $(NULL)
  32. .IF $(COMSPEC) == $(NULL)
  33.    SHELL := $(ROOTDIR)/bin/sh$E
  34. .ELSE
  35.    SHELL := $(COMSPEC)
  36. .END
  37. .END
  38. GROUPSHELL := $(SHELL)
  39.  
  40. # Now set remaining arguments depending on which SHELL we
  41. # are going to use.  COMSPEC (assumed to be command.com) or
  42. # MKS Korn Shell.
  43. .IF $(SHELL)==$(COMSPEC)
  44. SHELLFLAGS  := $(SWITCHAR)c
  45. GROUPFLAGS  := $(SHELLFLAGS)
  46. SHELLMETAS  := *"?<>
  47. GROUPSUFFIX := .bat
  48. .ELSE
  49. SHELLFLAGS  := -c
  50. GROUPFLAGS  :=
  51. SHELLMETAS  := *"?<>|()&][$$\#`'
  52. GROUPSUFFIX := .ksh
  53. .END
  54.  
  55. # Standard C-language command names and flags
  56.    CC      := cl        # C-compiler and flags
  57.    CFLAGS   = -nologo
  58.  
  59.    AS      := masm        # Assembler and flags
  60.    ASFLAGS  = -mx -t
  61.  
  62.    LD       = link        # Loader and flags
  63.    LDFLAGS  =
  64.    LDLIBS   =
  65.  
  66. # Definition of $(MAKE) macro for recursive makes.
  67.    MAKE = $(MAKECMD) $(MFLAGS)
  68.  
  69. # Language and Parser generation Tools and their flags
  70.    YACC      := yacc        # standard yacc
  71.    YFLAGS  =
  72.    YTAB      := ytab        # yacc output files name stem.
  73.  
  74.    LEX      := lex        # standard lex
  75.    LFLAGS  =
  76.    LEXYY  := lex_yy        # lex output file
  77.  
  78. # Other Compilers, Tools and their flags
  79.    PC    := any_pc        # pascal compiler
  80.    RC    := anyf77        # ratfor compiler
  81.    FC    := anyf77        # fortran compiler
  82.  
  83.    CO       := co        # check out for RCS
  84.    COFLAGS := -q
  85.  
  86.    AR     := ar            # archiver
  87.    ARFLAGS = ruv
  88.  
  89.    RM       := /bin/rm        # remove a file command
  90.    RMFLAGS  =
  91.  
  92. # Implicit generation rules for making inferences.
  93. # We don't provide .yr or .ye rules here.  They're obsolete.
  94. # Rules for making *$O
  95.    %$O : %.c  ; $(CC) -o $@ $(CFLAGS) -c $<
  96.    %$O : %$P ; $(PC) -o $@ $(PFLAGS) -c $<
  97.    %$O : %$S ; $(AS) -o $@ $<
  98.    %$O : %.cl ; class -c $<
  99.    %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  100.  
  101. # Executables
  102.    %$E : %$O ;
  103.     (LD) $(LDFLAGS) @<+$(<:t"+\n":s,/,\,)
  104.     $(@:s,/,\,),$(LDLIBS:t"+\n":s,/,\,)\n+>
  105.  
  106. # lex and yacc rules
  107.    %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  108.    %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  109.  
  110. # RCS support
  111. .IF $(_HAVE_RCS)
  112.    % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  113.    .NOINFER : $$(@:d)RCS/$$(@:f)$V
  114. .END
  115.  
  116. # SCCS support
  117. .IF $(_HAVE_SCCS)
  118.    % : s.% ; get $@
  119.    .NOINFER : s.%
  120. .END
  121.  
  122. # Recipe to make archive files.
  123. %$A :
  124. [
  125.    $(AR) $(ARFLAGS) $@ $?
  126.    $(RM) $(RMFLAGS) $?
  127. ]
  128.  
  129. # DMAKE uses this recipe to remove intermediate targets
  130. .REMOVE :; $(RM) -f $<
  131.  
  132. # AUGMAKE extensions for SYSV compatibility
  133. @B = $(@:b)
  134. @D = $(@:d)
  135. @F = $(@:f)
  136. *B = $(*:b)
  137. *D = $(*:d)
  138. *F = $(*:f)
  139. <B = $(<:b)
  140. <D = $(<:d)
  141. <F = $(<:f)
  142. ?B = $(?:b)
  143. ?F = $(?:f)
  144. ?D = $(?:d)
  145.  
  146. # Turn warnings back to previous setting.
  147. .SILENT := $(__.SILENT)
  148.  
  149. # Local init file if any, gets parsed before user makefile
  150. .INCLUDE .IGNORE: "_startup.mk"
  151.