02-20-04 04:33 AM
* Thus spoke bucket79 <bucket79@daum.net>:
Hallo,
> Hi. I just got a simple question about makefile
> There's file 1_1.c and INC, LIB declaration is fine.
> and i wanna make executable 1_1.out
[...]
> but what if i wanna make excutable 1_1 ?
> i mean, how can i set a implicit rule like .c.o when output file has no
> extension
Do you mean something like:
| CC = g++
| LD = g++
| CC_FLAGS = -Wall -W -ggdb -pg -c -g -DNDEBUG
| LD_FLAGS = -ggdb -o $(EXEC)
| ##EXEC = 1_1.out
| EXEC = 1_1
|
| SOURCES = foo.cpp bar.cpp
|
| ALL_OBJS = foo.o bar.o
|
| all : $(ALL_OBJS)
| $(LD) $(LD_FLAGS) $(ALL_OBJS)
|
| %.o : %.c
| $(CC) $(CC_FLAGS) $(LD) -o $@ $<
Wolfgang.
--
"I can remember the exact instant when I realized that a large part of my li
fe
from then on was going to be spent in finding mistakes in my own programs."
-- Maurice Wilkes, 1947
[ Post a follow-up to this message ]
|