Jump to content
  • Advertisement
Sign in to follow this  
maximAL

quick & simple makefile problem

This topic is 4443 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!