Date: Thu, 17 Mar 1994 23:42:51 +0100 From: Dirk Zabel To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Unix/DOS Makefiles Hi, Mark wrote: > Is there any way to generate a response file in GNU make when a variable > is > 128 characters? For example, if I have > OBJS = file1.c file2.c file3.c file4.c \ > ... > file99.c > I can't just do an "echo $(OBJS) > cmdline.tmp", since only the first 128 > characters of that command will be processed. Is there a simple solution to > this problem? Some people already pointed out that this problem is gone if you use D.J.'s port of gnu make 3.70, which is part of DJGPP 1.11. Unfortunately, I was not able to use gnu make 3.70 (is VERY slow on startup if I have a large makfile and aborts with "out of memory" message), so I'm still left with Thorsten Ohls quite old port of gnu make 3.58. This port was done using the "swapping library" (swalib) of the same author; part of this library is the possibility of automatic putting argv into environment variables _ARGV0, _ARGV1,... The nice thing is now, that all DJGPP-compiled programs as well as the binaries if DJGPP itself understand this convention; if you use gcc and ar with long argument lists, you have to put a line LONGARGS=gcc:ar into your makefile to let make know that gcc and ar accept arguments via environment. If you have other programs which need response files and don't accept environment args, you could use the simple "mkrf" program, which must be djgpp - compiled and consequently gets its argument from the environment, if you include it in the above LONGARGS definition. /* * * 1992 by Dirk Zabel * * usage: mkrf { } */ #include #include int main(argc, argv) int argc; char ** argv; { int i; FILE * fp; if (argc < 2) { fprintf(stderr,"usage: %s word ...n", argv[0]); exit(2); } fp=fopen(argv[1], "w"); if (!fp) { fprintf(stderr, "%s: can't open %s for output\n", argv[0], argv[1]); exit(3); } for (i=2; i