Sign in to follow this  

quick & simple makefile problem

This topic is 4229 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

This topic is 4229 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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