4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 GCC and the -I switch
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Mon Nov 08, 2004 8:39 pm (12 years, 11 months ago) Reply with QuoteBack to Top

Hello,

I've got some C files that I want to compile. Meanwhile I want to use other "include" libraries as system, instead of those that are by default. That is done with the "-I" switch. The problem is that I made the following Makefile:

Quote:


CC=gcc

CFLAGS = -ansi -pedantic -Wall -g -I/other/dir/include

TARGETS = sephem look

all: $(TARGETS)

clean:
rm *.o
rm *.log
rm *.exe


sephem: sephem.o astrolib.o astrocon.o support.o
$(CC) $(CFLAGS) -o sephem sephem.o astrolib.o \ astrocon.o support.o

look: look.o
$(CC) $(CFLAGS) -o look look.o $(LIBS)

sephem.o: sephem.c astrolib.h support.h
$(CC) $(CFLAGS) -c sephem.c

look.o: look.c
$(CC) $(CFLAGS) -c look.c

astrolib.o: astrolib.c astrolib.h astrocon.h support.h
$(CC) $(CFLAGS) -c astrolib.c

astrocon.o: astrocon.c astrocon.h
$(CC) $(CFLAGS) -c astrocon.c

support.o: support.c support.h
$(CC) $(CFLAGS) -c support.c


I've tryed the command "gcc -I/other/dir/include -o look look.c" and it worked. Why doesn't work for the Makefile?

Something I missed?

Regards,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.057903 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme