[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: GNUstep make with differently-named makefiles
From: |
Nicola Pero |
Subject: |
RE: GNUstep make with differently-named makefiles |
Date: |
Tue, 24 Jun 2008 12:18:32 +0200 (CEST) |
Hi Michael,
> Can GNUstep make use a file other than the default 'GNUmakefile'? In
> (p)make you just use '-f othermakefile.. '.
Yes. You do it as in
make MAKEFILE_NAME=othermakefile
I couldn't find it documented anywhere though. I'll add it to the output
of 'make print-gnustep-make-help' so hopefully it will be easier to find
for other people in the future ;-)
> Want to build the same code linking to different libraries, including
> different headers etc and would like to keep the settings in different
> make files as I do for plain C builds.
OK. You can also consider conditionally including different makefile fragments.
Ie, something like
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = tool
tool_OBJC_FILES = main.m
ifeq ($(MICHAEL_TYPE_OF_BUILD),quick)
include quick-settings.make
else
include other-settings.make
endif
include $(GNUSTEP_MAKEFILES)/tool.make
and then you put all your different library/flag/etc. settings in
quick-settings.make
and other-settings.make. You can easily switch between the two by doing
make MICHAEL_TYPE_OF_BUILD=quick
versus
make
(obviously change the variable names to whatever suits you). Not sure if it
appeals
to you - just an idea.
> Whilst I am at it, a Q that will be coming up in the next few days is
> 'how do I call a different compiler than the system default?'. Haven't
> looked into this one yet so maybe the answer is written somewhere,
> before someone shouts RTFM...
Usually
make CC=mygcc
should work. Or, if you're using a different makefile, put CC=mygcc in the
makefile itself (after including common.make). ;-)
Thanks