Sign in to follow this  
maximAL

quick & simple makefile problem

Recommended Posts

hi there, now, i got a problem with a tiny makefile that is obviously just to simple to find.
CC=gcc
CFLAGS=-c -g -Wall -o0
LDFLAGS=

ZAPSOURCES=zap.c 	list/list.c 	procinfo.c

ZAPOBJECTS=$(ZAPSOURCES:.c=.o)

ZAPEXECUTABLE=zap.out

all: $(ZAPSOURCES) $(ZAPEXECUTABLE)

zap: $(ZAPSOURCES) $(ZAPEXECUTABLE)


$(ZAPEXECUTABLE): $(ZAPOBJECTS) 
	$(CC) $(LIBS) $(LDFLAGS) $(ZAPOBJECTS) -o $@

.c.o:
	$(CC) $(CFLAGS) $< -o $@

.PHONY: clean

clean:
	\rm *.o *~
why does the all: target work, but the zap: target gives me a linker error? i can even let all: point to zap:, same result. [crying]

Share this post


Link to post
Share on other sites
I can't see anything obvious wrong - make sure you've got tabs in the right places, sometimes that confuses make. If you're able (or willing) to use something other than make I would strongly suggest SCons.


import os

env = Environment(ENV = os.environ(),
CCFLAGS = '-g -Wall -O0')
env.Program('zap.out', [ 'zap.c', 'list/list.c', 'procinfo.c' ] )

Share this post


Link to post
Share on other sites
no, i have to use make...
well, i put together another more naive makefile that does the job, but this issue is still bugging me *grr*

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this