From: dman <ds...@ri...> - 2002-01-11 03:03:15
|
Attached is a patch for the Makefile. The first difference is that the clean target wasn't working for me. "rm *.{o,d}" wasn't removing the files, so I changed it to "rm *.o *.d". I also made a couple of changes that will reduce the overhead of the build process. Unlike a shell script, a Makefile works by textual substitution. So, a line like GTK_INCLUDES = `gtk-config --cflags gtk gthread` doesn't execute gtk-config but simply puts that whole string in a variable. When this variable is expanded in a shell command (when gcc is run) _then_ the shell creates the subshell to run gtk-config in. This means that gtk-config is run once for every file that is compiled. I changed this to instead run the script in a subshell once and use the result repeatedly. The other change restricts the Makefile to work only with GNU make (but since 'gcc' and 'g++' are explicitly used I don't think this is a problem). The change is the ":=" operator. As stated above, make operates on textual substitution. Thus lines like : VAR=value VAR2=${VAR} VAR2 gets the value "${VAR}". ${VAR} isn't expanded until ${VAR2} is expanded. Then it is expanded every time ${VAR2} is expanded. The ":=" operator expands the string immediately and binds that result to VAR2. This reduces the number of lookups and expansions that make has to do. For a project as small as vpython is right now these changes are likely to be insignificant. The final change I made was to make PYTHON_INCLUDES work for my system. (I don't expect that to be included in cvs, but I don't want to butcher the patch so that it doesn't work :-)) I thought there was a way to override this in the environment without changing the Makefile, but it didn't work when/how I tried it. HAND, -D PS. Is there a -dev list? I didn't see one. -- Pleasant words are a honeycomb, sweet to the soul and healing to the bones. Proverbs 16:24 |