|
Dear List:
I cut the result of a makefile-tutorial as follows (with
purple color).
It is not difficult to know the meaning of
: by keeping the concept (taget : dependency)
I wonder whether it can be auto-generated for given
source-files
distributed under lots of subdirectory ? (Of course , I dont expect that those CFlAGS & CC can be
auto-generated .)
OBJS = MovieList.o Movie.o NameList.o Name.o Iterator.o
CC = g++
DEBUG = -g
CFLAGS = -Wall -c $(DEBUG)
LFLAGS = -Wall $(DEBUG)
p1 : $(OBJS)
$(CC) $(LFLAGS) $(OBJS) -o p1
88
MovieList.o : MovieList.h MovieList.cpp Movie.h NameList.h Name.h Iterator.h
$(CC) $(CFLAGS) MovieList.cpp
Movie.o : Movie.h Movie.cpp NameList.h Name.h
$(CC) $(CFLAGS) Movie.cpp
NameList.o : NameList.h NameList.cpp Name.h
$(CC) $(CFLAGS) NameList.cpp
Name.o : Name.h Name.cpp
$(CC) $(CFLAGS) Name.cpp
Iterator.o : Iterator.h Iterator.cpp MovieList.h
$(CC) $(CFLAGS) Iterator.cpp
clean:
\rm *.o *~ p1
tar:
tar cfv p1.tar Movie.h Movie.cpp Name.h Name.cpp NameList.h \
NameList.cpp Iterator.cpp Iterator.h
BestRegards'
Henry
|
