bug-make
[Top][All Lists]
Advanced

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

RE: source file extension


From: Martin Dorey
Subject: RE: source file extension
Date: Wed, 20 Oct 2010 15:44:03 -0700

> define assert
> $(call assert,$($ARGS), The variable "$ARGS" is null)
> endef

This code is dead - nothing calls it.  I see that it includes an expression 
that will be evaluated (if it's ever called) as $(A)RGS when it was probably 
intended to say $(ARGS).

> SRCS = $(wordlist 2, 999, $(ARGS))

What sets ARGS?  Not make:

address@hidden:/tmp$ make -f badger.make -p 2>&1 | grep ARGS
address@hidden:/tmp$ 

Putting spaces after commas helps readability but it's generally a bad idea in 
makefiles.  It's semantically significant:

address@hidden:/tmp$ cat > badger.make
SRCS := $(subst a, b, bac)
address@hidden:/tmp$ make -f badger.make -p 2>&1 | grep SRCS
SRCS :=  b bc
address@hidden:/tmp$ 

> $(EXEC-FILE): $(SRCS:%.o=%.mod)
> # $(LINK) $@ $^                                                               
>                    $(LINK) $^ -o $@

The first line after the colon must start with a tab.  Perhaps it does already 
but something bad happened to that rule, perhaps in transit, likely from my 
mail client (sorry).

Now, sigh, this is going to sound patronising, for which I apologize, but 
hopefully you'll appreciate that more than just going silent on you:

Bug reports should show what you typed and what the computer displayed.  It 
would also be a good idea to include which version of make you're using and 
ideally on which platform.  This mailing list is really for bugs in Make 
itself, not for bugs in makefiles.  I believe there's a help-make list for that.

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Duke Normandin
Sent: Wednesday, October 20, 2010 15:21
To: Paul Smith
Cc: address@hidden
Subject: Re: source file extension

On Wed, 20 Oct 2010, Paul Smith wrote:

> On Wed, 2010-10-20 at 16:08 -0600, Duke Normandin wrote:
> > %.o:%.mod
> >    $(MODULA) %<
>
> This should be "$<", not "%<".

I should use my "good eye" when I program and debug! Thanks for
catching that. Unfortunately fixing the typo didn't solve the
problem. Any other ideas?
-- 
Duke

_______________________________________________
Bug-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-make


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Duke Normandin
Sent: Wednesday, October 20, 2010 15:09
To: address@hidden
Subject: source file extension

Hello list...

I recently cobbled together a "generic" Makefile for an Oberon-2
compiler - with the help of 2 generous hackers on this list. Works
great with Oberon.

Today I tried the same Makefile with a Modula-2 compiler, after making
the necessary changes. The Modula compiler is really a gcc
front-end. It behaves pretty much like the Oberon compiler. However,
the Makefile doesn't seem to want to create the object file when used
for the Modula-2 compiler. The Modula-2 source code file extension is
".mod", as opposed to a single-char extension, like .c, or .m . Could
that be the problem? Here's the relevant code:

define assert
$(call assert,$($ARGS), The variable "$ARGS" is null)
endef

# save CLI arguments                                                            
               EXEC-FILE = $(word 1, $(ARGS))                                   
                              SRCS = $(wordlist 2, 999, $(ARGS))

LINK = gm2                                                                      
               MODULA = gm2 -c
$(EXEC-FILE): $(SRCS:%.o=%.mod)
# $(LINK) $@ $^                                                                 
                 $(LINK) $^ -o $@
%.o:%.mod
   $(MODULA) %<
Much obliged!                                                                   
               --
Duke

_______________________________________________
Bug-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-make


reply via email to

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