discuss-gnustep
[Top][All Lists]
Advanced

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

Re: file-specific optimization options?


From: Nicola Pero
Subject: Re: file-specific optimization options?
Date: Tue, 6 Nov 2001 14:59:39 +0000 (GMT)

> Does anyone know (i) if there is a portable replacement for
> this pragma, or (ii) if there is support in gnustep-make for
> file-specific CC options? If not, can anyone suggest a
> workaround?

(ii): gnustep-make does not support file-specific CC options ... hmmm ...
we might add the facility to specify additional compiler flags for a
specific file ... but it wouldn't fix your problem, because you want to
*remove* the -O% flags for a single file rather than add it ... unless we
also add the possibility of specifying a file-specific pattern to
filter-out from the flags when compiling that specific file ... I can
probably implement all this stuff but I'm not sure how much real use it
would be and how much would just be confusing and making gnustep-make
source code more obscure ... if anybody has convincing examples/real life
cases in which it might be useful to be able to add/remove specific flags
for a single file, please let me know!  you might convince me to actually
implement it.

anyway - as a workable real life solution, you might try to set up a
subproject containing the only file you want to compile with different
flags, and set the special flags in that subproject.

say that you are compiling a library - you had 

-----
include $(GNUSTEP_MAKEFILES)/common.make

LIBRARY_NAME = libStephen

libStephen_OBJC_FILES = one.m two.m three.m four.m
libStephen_... etc other stuff

include $(GNUSTEP_MAKEFILES)/library.make
------
say that you want to compile two.m without -O% ...

you put in the subdirectory two/; in the directory you put a GNUmakefile
as follows
-----
include $(GNUSTEP_MAKEFILES)/common.make

SUBPROJECT_NAME = two

two_OBJC_FILES = two.m

include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
-------
In two/GNUmakefile.preamble you set up all your special flags.

the main library GNUmakefile is modified as follows - 
-------
include $(GNUSTEP_MAKEFILES)/common.make

LIBRARY_NAME = libStephen

libStephen_OBJC_FILES = one.m three.m four.m
libStephen_... etc other stuff

libStephen_SUBPROJECTS = two

include $(GNUSTEP_MAKEFILES)/library.make
------
this should compile the subproject two/ (with its own specific flags), and
then link it into the main library.




reply via email to

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