|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
CC = gcc
SRCS = a.c b1.c c1.c OBJS = $(addsuffix .o, $(basename $(SRCS) .c)) target: $(OBJS) $(CC) $(LDFLAGS) $(OBJS) -o target somehow make does not like the line that sets up OBJS says that no rules to make target found but if replaced as OBJS = a.o b1.o c1.o it works! Any pointers? -ishwar -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
ISHWAR RATTAN wrote:
> CC = gcc > SRCS = a.c b1.c c1.c > OBJS = $(addsuffix .o, $(basename $(SRCS) .c)) > > target: $(OBJS) > $(CC) $(LDFLAGS) $(OBJS) -o target > > somehow make does not like the line that sets up OBJS > says that no rules to make target found but if replaced > as > OBJS = a.o b1.o c1.o > > it works! > > Any pointers? > -ishwar > > $ basename a.c b1.c c1.c .c basename: extra operand `c1.c' Try `basename --' for more information. $ $ basename a.c .c a $ basename b1.c .c b1 $ basename c1.c .c c1 The 'basename' command fails, 'addsufix' gets no arguments, hence nothing is in the OBJS variable. -- Bob McGowan Symantec, Inc. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 9/10/07, ISHWAR RATTAN <rattan@cps.cmich.edu> wrote:
> CC = gcc > SRCS = a.c b1.c c1.c > OBJS = $(addsuffix .o, $(basename $(SRCS) .c)) > > target: $(OBJS) > $(CC) $(LDFLAGS) $(OBJS) -o target > > somehow make does not like the line that sets up OBJS > says that no rules to make target found but if replaced > as > OBJS = a.o b1.o c1.o > > it works! > > Any pointers? If you're using gmake or a gnu-compatible make, you can do: OBJS := $(patsubst %.c,%.o,$(SRCS)) -- Michael A. Marsh http://www.umiacs.umd.edu/~mmarsh http://mamarsh.blogspot.com http://36pints.blogspot.com -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|