Makefile issue

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

 



Hi folks!

Friends I am preparing a make file but its giving target not needed by a1.c.target a1.o stop.
Here is the procedure
CC=/usr/sfw/bin/gcc
CFLAGS=-g -Wall
SRC=/Module/src
INCLUDE=/usr/include \
             /Module/header
             //path for header files gtk,gdk,atk,pango etc.
LIBS       =lsocket \
               lnsl \
               lpthread \
              path for library packages for gtk,gdk etc.

#MODULE 1 has following files a1.c ,a2.c,a3.c and a1.h,a2.h and a3.h
#MODULE 2 has following files b1.c ,b2.c,b3.c and b1.h,b2.h,b3.h
#MODULE 3 has following files c1.c ,c2.c,c3.c and c1.h,c2.h,c3.h

#There is a top level folder called Module which contains src and header subfolders. #In src subfolder contain module1,2 and 3 which contains source filesrespective to the module and #in /module/header contains subfolder module 1,2 and 3 which contain header files.
#Makefile is saved in /Module/makefile

OBJS=a1.o a2.o a3.o b1.o b2.o b3.o c1.o c2.o c3.o

a1.o:a1.c
              $(CC)  -$INCLUDE -$(CFLAGS)  -I.  -I$(SRC)  -c $<
a2.o:a2.c
              $(CC)  -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
a3.o:a3.c
              $(CC)  -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
b1.o:b1.c
              $(CC)   -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
b2.o:b2.c
              $(CC)  -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
b3.o:b3.c
              $(CC)   -$INCLUDE  -$(CFLAGS)  -I.  -I$(SRC)  -c $<
c1.o:c1.c
              $(CC)   -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
c2.o:c2.c
              $(CC)   -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<
c3.o:c3.c
              $(CC)   -$INCLUDE  -$(CFLAGS) -I.  -I$(SRC)  -c $<

all:parikshit
$(CC) -$(OBJS)  -$INCLUDE  -$(CFLAGS) -$LIBS --g -o parikshit


As far as my knowledge goes '$< ' will automatically search the mentioned source file in the folder mentioned by SRC .for example in this case
a1.o:a1.c
              $(CC)  -$INCLUDE -$(CFLAGS)  -I.  -I$(SRC)  -c $<
'$<' will automatically search the source file in the path mentioned by SRC(/Module/src) macro. i.e.above thing will automatically search source file a1.c in /Module/src/ Module1/a1.c

So same thing for above source files.So why target is not being made.

Please help me .I will be highly thankful if somebody will come up with solution or mentioning any mistake made by me.Please reply as soon as possible as things are being halted for me.

Regards
Parikshat Dubey

_________________________________________________________________
Sexy, sultry, sensuous. - see why Bipasha Basu is all that and more. Try MSN Search http://server1.msn.co.in/Profile/bipashabasu.asp


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux