############################################################################## # This software is distributed under the terms of the General Public License.
#
# Program :   kastrolog 5.4 beta 3
# Authors : see the AUTHORS file
# E-Mail  : Llyra@altavista.com
############################################################################# 


CC  = gcc
CXX = g++
DEP = .depends
LIBS = -lqt -lkdecore -lkdeui -lkfile -lkfm
INCLUDE = -I/usr/local/lib/qt/include -I/opt/kde/include
LDFLAGS = -L/opt/kde/lib
CXXFLAGS = -pipe -O3
CFLAGS = -pipe -O3	
PROG = kastrolog

# you shouldn't modify beyond this

HEAD1 = AstroCommand.h AstroInfo.h ColorVector.h SetAstroColor.h SetColors.h \
 AspectSet.h AstroSetAspects.h ObjectSet.h AstroObjectSet.h Restrictions.h \
 StarRestrict.h CalcSettings.h ObscureSettings.h AstroTransits.h \
 AstroProgress.h ChartDetails.h GraphSettings.h
HEAD2 = $(patsubst %.h,%Data.h, $(HEAD1))
HEADERS = AstroMenu.h AstroWidget.h $(HEAD1) $(HEAD2)
SRC1 = $(patsubst %.h,%.cpp, $(HEAD1))
SRC2 = main.cpp AstroMenu.cpp AstroWidget.cpp AstroColor.cpp AstroIcon.cpp
SRC3 = $(SRC1) $(patsubst %.cpp,%Data.cpp, $(SRC1)) $(patsubst %.h,m%.cpp, $(HEADERS)) $(SRC2)
SRC4 = astrolog.c calc.c charts0.c charts1.c charts2.c charts3.c data.c \
 data2.c general.c intrpret.c io.c matrix.c placalc.c placalc2.c xcharts0.c \
 xcharts1.c xcharts2.c xdata.c xdevice.c xgeneral.c xscreen.c
CPPOBJS = $(subst .cpp,.o,$(SRC3))
OBJS = $(CPPOBJS) $(subst .c,.o,$(SRC4))

all: $(PROG)

m%.cpp : %.h
	moc -o $@ $<

%.o   : %.cpp
	$(CXX) $(INCLUDE) $(CXXFLAGS) -o $@ -c $<

%.o   : %.c
	$(CC) $(INCLUDE) $(CFLAGS) -o $@ -c $<

$(SRC1):

$(HEADERS):

$(PROG): $(OBJS)
	$(CXX) -o $@ $(LDFLAGS) $^ $(LIBS)

clean:
	rm *.o $(PROG) $(patsubst %.h,m%.cpp, $(HEADERS))

$(DEP):
	echo > $@

depend: $(DEP)
	$(CXX) $(INCLUDE) -MM -E $(SRC1) $(SRC2) > $(DEP)
	$(CC)  $(INCLUDE) -MM -E $(SRC4) >> $(DEP)

cppgettext: $(SRC3)
	xgettext -C -ktr -o ../po/cppmess.po $^

cgettext: $(SRC4)
	xgettext -ktr -o ../po/cmess.po $^

gettext: cgettext cppgettext

include $(DEP)










