help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing contents of large variable into a file


From: daniel.steinmann
Subject: Writing contents of large variable into a file
Date: Fri, 18 Feb 2005 10:56:41 +0100

I have a variable JAVA_SRCS which contains all my java files. I want to invoke 
the java compiler to compile all those files in one invocation. 

Unfortunately I could not figure out how to write the content of JAVA_SRCS into 
a file without running into the shell limit:

   make: execvp: /bin/sh.exe: Argument list too long
   make: *** [compile] Error 127

Any ideas how to solve this problem?

Thanks,
Daniel

---

test_dir = spool
tmp_dir = $(test_dir)/this/is/a/rather/heavily/nested/directory/structure
tmp_file = this_is_a_rather_long_file_name_to_demonstrate_my_problem

JAVAC = $(JAVA_HOME)/bin/javac
JAVA_SRCS = $(wildcard $(tmp_dir)/*.*)

compile : $(test_dir)
    echo $(JAVA_SRCS) > $@
    $(JAVAC) -g @$@

$(test_dir) :
    mkdir -p $@
    mkdir -p $(tmp_dir)
    for i in $$(seq 1 300); do \
        touch $(tmp_dir)/$(tmp_file).$$i; \
    done
    touch $@

clean :
    rm -rf $(test_dir)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]