GTK+ (embarrassing) Makefile question...



This Makefile will recreate GTK+ object file if header file
is "touched" with touch command which is good....

It will NOT recreate object file when *.cpp file is 
"touched" the same way.

WHY IS the "%.o: %.h" rule working
but the "%.o: %.cpp" rule IS NOT!!??!?!?

Here is makefile...

PROGRAM =	Main

CPPC 	=	g++

FLAGS   =	`gtk-config --cflags`

LIBS    =	`gtk-config --libs` -lpthread

SRCS    =	AESRSimulator.cpp EulerMaruyama.cpp Main.cpp \
		RandomNumber.cpp SignalProcessing.cpp \
		Window.cpp GUI.cpp

OBJS    =	$(SRCS:.cpp=.o)

%.o:		%.h
		$(CPPC) $(FLAGS) -c $*.cpp

%.o:		%.cpp
		$(CPPC) $(FLAGS) -c $<

all:		$(PROGRAM)

$(PROGRAM):	$(OBJS)
		$(CPPC) $(OBJS) $(LIBS) -o $(PROGRAM)

clean:
		rm -f $(OBJS) $(PROGRAM)


-- 
=======================================================
| Dr. Christian Seberino  || (619) 553-7940  (office) |
| SPAWARSYSCEN 2363       || (619) 553-2836  (fax)    |
| 53560 HULL ST           ||                          |
| SAN DIEGO CA 92152-5001 || seberino spawar navy mil |
=======================================================




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