Re: [cc65] Building with custom CC and CFLAGS

From: Per Olofsson <magervalp1gmail.com>
Date: 2009-10-01 08:24:48
On Wed, Sep 30, 2009 at 11:38 AM, Greg King <greg.king4@verizon.net> wrote:
> From: "Per Olofsson"; on Monday, Sept. 28, 2009; at 09:54 AM -0400
>> On Mon, Sep 28, 2009 at 2:17 PM, Greg King wrote:
>> > You just will have to settle for two commands:
>> >
>> > make -f make/gcc.mak bins docs CC=clang CFLAGS=-O4
>>
>> That doesn't work, because gcc.mak, itself, calls make,
>> without CC and CFLAGS.
>
> Try it again.  I "tore down" a fence that used to block those assignments.

I did, and sent you a patch that fixes it in a nicer way, since it
also solves problem 2:

> make bins docs CC=clang CFLAGS=-O4
> make libs
>
> Hmm, I just had a thought:  maybe, I can ask Gnu make about the origin of
> CC.  When it does not come from the command line, the make-file can run the
> "libs" rule.  I'll check the docs...

With my changes you can build with a single make command, and specify
CC and CFLAGS inside the makefile. Much cleaner:

--- cc65-2.13/make/gcc.mak	2009-10-01 08:23:45.000000000 +0200
+++ cc65/make/gcc.mak	2009-09-29 15:08:48.000000000 +0200
@@ -14,6 +14,10 @@
 #MAKEOVERRIDES=
 # (That trick has been disabled.)

+# To compile with custom make options, set them here, for example:
+MAKEOPTS = CC=clang CFLAGS=-O4 -j 2
+#MAKEOPTS =
+
 # The install prefix and directories
 prefix		= /usr/local
 exec_prefix	= $(prefix)
@@ -58,7 +62,7 @@
 all:	bins libs docs $(SYS:%=samples tests)

 bins:
-	@$(MAKE) -C src -f make/gcc.mak CA65_INC=\\\"${CA65_INC}/\\\" \
+	@$(MAKE) $(MAKEOPTS) -C src -f make/gcc.mak CA65_INC=\\\"${CA65_INC}/\\\" \
 	  CC65_INC=\\\"${CC65_INC}/\\\" LD65_CFG=\\\"${LD65_CFG}/\\\" \
 	  LD65_LIB=\\\"${LD65_LIB}/\\\" LD65_OBJ=\\\"${LD65_OBJ}/\\\"
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Oct 1 08:24:53 2009

This archive was generated by hypermail 2.1.8 : 2009-10-01 08:24:56 CEST