# Generated automatically from Makefile.in by configure.
SHELL = /bin/sh

LIBDIRS = libannotate libdisplay libimage libprojection libsgp4sdp4
XPLIBS = libdisplay/libdisplay.a				\
	libimage/libimage.a libprojection/libprojection.a	\
	libsgp4sdp4/libsgp4sdp4.a libannotate/libannotate.a 

CP = /bin/cp
GZIP = /bin/gzip
INSTALL = /usr/bin/install -c
RM = /bin/rm
STRIP = /usr/bin/strip
TAR = /bin/tar


prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
mandir = ${prefix}/man
auxdir = ${prefix}/share/xplanet
version = 0.90
distdir = xplanet-$(version)

CC = gcc
CPPFLAGS += -I${prefix}/include -Wall -O3 -I.
CXX = c++
CXXFLAGS += -I/home/hari/local/include/freetype2  -I/usr/X11R6/include  $(CPPFLAGS)

LIBS += -L${exec_prefix}/lib 

SRCS = xplanet.cc				\
	glutfuncs.cc				\
	Location.cc				\
	Marker.cc				\
	moonpos.cc				\
	Options.cc				\
	Planet.cc				\
	Ring.cc					\
	Satellite.cc				\
	ssec.cc					\
	util.cc 

OBJS = $(SRCS:.cc=.o) getopt.o getopt1.o xp_getopt.o 

.cc.o: 
	$(CXX) -c $(CXXFLAGS) $< 

all: xplanet xplanetbg

xplanet: $(OBJS) libs 
	$(CXX) -o $@ $(OBJS) $(XPLIBS) $(LIBS)  -L/usr/X11R6/lib -lX11 -lXmu -lXi -lglut -lGL -lGLU	\
  -lgif  -L/usr/X11R6/lib -lX11 -ljpeg -lpng -lm -lz -lnetpbm -ltiff -lm -L/home/hari/local/lib -lfreetype 

xplanetbg: xplanetbg.o orbit.o getopt.o getopt1.o xp_getopt.o	\

	$(CXX) -o $@ $^  -L/usr/X11R6/lib -lX11 -lm

libs:
	list='$(LIBDIRS)'; for subdir in $$list; do	\
	(cd $$subdir; $(MAKE))				\
	done

xplanet.o: auxfiles.h checkfuncs.h Options.h Planet.h \
util.h libimage/libimage.h

glutfuncs.o: auxfiles.h xplanet.h

Location.o: Location.h util.h

Marker.o: Marker.h Options.h util.h

moonpos.o: util.h

Options.o: checkfuncs.h auxfiles.h Options.h util.h xp_getopt.h

Planet.o: Options.h Planet.h util.h

Ring.o: Location.h Options.h Ring.h satrings.h

ssec.o: Options.h util.h libimage/libimage.h 

util.o: Options.h xplanet.h libimage/libimage.h

install: all
	$(INSTALL) -d $(bindir)
	$(INSTALL) xplanet $(bindir)
	$(INSTALL) xplanetbg $(bindir)
	$(INSTALL) -m 755 tkxplanet $(bindir)
	$(INSTALL) -m 755 tzcoord.pl $(bindir)
	$(INSTALL) -d $(mandir)
	$(INSTALL) -d $(mandir)/man1
	$(INSTALL) -m 644 tkxplanet.1 $(mandir)/man1
	$(INSTALL) -m 644 tzcoord.pl.1 $(mandir)/man1
	$(INSTALL) -m 644 xplanet.1 $(mandir)/man1
	$(INSTALL) -m 644 xplanetbg.1 $(mandir)/man1
	$(INSTALL) -d $(auxdir)
	$(CP) -r auxdir/* $(auxdir)

install-strip: install
	$(STRIP) $(bindir)/xplanet
	$(STRIP) $(bindir)/xplanetbg

uninstall:
	-$(RM) -f $(bindir)/xplanet
	-$(RM) -f $(bindir)/xplanetbg
	-$(RM) -f $(bindir)/tkxplanet
	-$(RM) -f $(bindir)/tzcoord.pl
	-$(RM) -f $(mandir)/man1/xplanet.1
	-$(RM) -f $(mandir)/man1/xplanetbg.1
	@echo "*** Not removing " $(auxdir) " ***"

dist: 	
	$(INSTALL) -d $(distdir)
	$(CP) COPYING CREDITS ChangeLog FAQ INSTALL Makefile* README *.c \
	*.cc *.h *.h.in tkxplanet* tzcoord.pl* aclocal.m4 configure* *.1 \
	$(distdir)
	$(CP) -r autoconf $(distdir)
	list='$(LIBDIRS)'; for subdir in $$list; do \
	($(CP) -r $$subdir $(distdir)) \
	done
	$(CP) -r auxdir $(distdir)
	$(TAR) cf $(distdir).tar $(distdir)
	$(GZIP) -9 $(distdir).tar
	-$(RM) -fr $(distdir)

clean:
	-$(RM) -f *.o 
	list='$(LIBDIRS)'; for subdir in $$list; do	\
	(cd $$subdir; $(MAKE) clean)			\
	done

distclean:
	-$(RM) -f *.o *~ auxfiles.h checkfuncs.h xplanet	\
	xplanetbg xplanetbg.h					\
	config.* tkxplanet tzcoord.pl Makefile;			\
	list='$(LIBDIRS)'; for subdir in $$list; do		\
	(cd $$subdir; $(MAKE) distclean)			\
	done
