delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/10/27/08:26:18

Date: Tue, 27 Oct 92 14:17:17 PRT
From: Jose Manuel Cerqueira Esteves <FESTEVES AT ptearn>
Subject: MAKE programs for use with DJGPP
To: djgpp AT sun DOT soe DOT clarkson DOT edu

Greetings

I have been using DMAKE (Version 3.80, PL 1) with DJGPP, and was able
to make it create response files automatically, under COMMAND.COM, for
specified programs, using a startup file (STARTUP.MK) which includes the
following:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    .
    .  (ommited stuff)
    .
   .IF $(SHELL)==$(COMSPEC)
      SHELLFLAGS  := $(SWITCHAR)c
      GROUPFLAGS  := $(SHELLFLAGS)
      SHELLMETAS  := *"?<>
      GROUPSUFFIX := .bat
   #  DIRSEPSTR   := \\
   #  The following value of DIRSEPSTR provides support for DJGPP programs
   #  (they accept "/" and sometimes have problems with "\")
      DIRSEPSTR    = $(null,$($(CMNDNAME)_DJ) \\ /)
      DIVFILE      = $(TMPFILE:s,/,\)
   .ELSE
      SHELLFLAGS  := -c
      GROUPFLAGS  :=
      SHELLMETAS  := *"?<>|()&][$$\#`'
   #  (I haven't checked if the above is correct for MS_SH)
      GROUPSUFFIX := .sh
   #  .MKSARGS    := yes
      DIVFILE      = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
      DIVSEP_shell_yes := \\\
      DIVSEP_shell_no  := \\
   .END

   # Standard C-language command names and flags
      CPP     := cpp            # C-preprocessor
      CC      := gcc            # C-compiler and flags
      CFLAGS  +=
    .
    .
    .
   #  Support for response files under COMMAND.COM:
   .IF $(SHELL)==$(COMSPEC)
      $(CPP)_DJ := _DJ
      $(CC)_DJ := _DJ
      $(AS)_DJ := _DJ
      $(LD)_DJ := _DJ
      $(AR)_DJ := _DJ
       .
       .
       .
   #  For the above commands, create response file, with "/" instead of "\":
      CMNDARGS_DJ = @$(mktmp $(CMNDARGS:s,\,/)\n)
      COMMAND = $(CMNDNAME) $(CMNDARGS$($(CMNDNAME)_DJ))
   .END
     .
     .
     .
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This has been working OK (however, response files are ALWAYS created,
even for small command lines). There is an annoying feature: what is displayed
is the command line with "@response_file_name" instead of the expanded command
line, which would be nice. I believe that DMAKE is flexible enough to make
it display the expanded line ("silencing" normal display of the executed
command and echoing the command name followed by the contents of the response
file), but I haven't tried that yet.

Yesterday, I installed MS-Shell (MS-DOS SH 2.0), hoping that NDMAKE,
GNU Make and DMAKE could be used under it, leaving the task of response
file creation to the shell.  I tried to use GNU Make and DMAKE with a
makefile which included a call to "ar" to create a library file from a
lot of object files.  When GNU Make did not crash the PC (a 486 with 8 Mb RAM)
or give the message

  Fatal error in memory management. Aborting.
  Reason: Can't reallocate core

(among others...), it complained about the length of the command line.
DMAKE also complained about the length of the argument list for ar:

  DMAKE.EXE:  Error -- ar: Arg list too big

(the mechanism shown above for creation of response files by DMAKE was
not active under MS-Shell, because I expected that long argument lines
could be handled by the shell).  I tried to call  ar  with the same
argument list, NOT using DMAKE, and it worked; it is DMAKE that
refuses to pass a big argument list.

Therefore I have the following questions:
- Is there a way to convince DMAKE to pass long argument lists to the
  shell? (I know that DMAKE can be used with the MKS shell, but I do not
  have this...) Is it necessary to recompile DMAKE ? (has anyone done this with
  DJGPP?).
  Another problem with DMAKE is that it does not accept response files
  (this would be nice because some makefiles call MAKE with very long command
  lines).
- Has anyone solved the problems with GNU Make that were mentioned above?
  (I have the MS-DOS port of version 3.58).

Thank you in advance.

                           Jose Esteves

P.S. (for those who have never used DMAKE and hate TABs as much as I do :-)
     If you have ever wanted to use a MAKE which accepts spaces instead
     of TABs to begin recipe lines, use DMAKE!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019