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

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

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

CXX = c++
CXXFLAGS += -Wall -O3 -I/usr/X11R6/include  -I/usr/X11R6/include -I$(includedir)

X_LIBS = -L/usr/lib -lImlib -ljpeg -ltiff -lungif -lpng -lz -lm -lXext -L/usr/X11R6/lib -lSM -lICE -lXext -lX11  -L/usr/X11R6/lib  -lSM -lICE  -lX11

OPENGLLIBS = -lglut -lXmu -lXi -lMesaGL -lMesaGLU 

LIBS = $(OPENGLLIBS) $(X_LIBS) 

SRCS = \
	xplanet.cc \
	glutfuncs.cc \
	image.cc \
	location.cc \
	moonpos.cc \
	options.cc \
	ortho.cc \
	planet.cc \
	sunpos.cc \
	text.cc \
	util.cc 

OBJS = $(SRCS:.cc=.o)
AUXDIR = $(notdir $(wildcard auxdir/*.ppm auxdir/*-markers.txt))

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

all: xplanet xplanetbg

xplanet: $(OBJS)
	$(CXX) -o $@ $(OBJS) $(LIBS)

xplanetbg: xplanetbg.o orbit.o
	$(CXX) -o $@ $^ $(X_LIBS)

xplanet.o: xplanet.cc auxfiles.h image.h options.h planet.h text.h util.h

glutfuncs.o: glutfuncs.cc xplanet.h image.h

image.o: image.cc location.h options.h planet.h text.h util.h xplanet.h

location.o: location.cc location.h util.h

moonpos.o: moonpos.cc util.h

options.o: options.cc options.h checkfuncs.h util.h xplanet.h 

ortho.o: ortho.cc location.h options.h util.h

planet.o: planet.cc planet.h util.h

sunpos.o: sunpos.cc util.h

text.o: text.cc image.h location.h options.h planet.h text.h util.h xplanet.h

util.o: util.cc 

xplanetbg.o: xplanetbg.cc checkfuncs.h orbit.h 

orbit.o: orbit.cc orbit.h

install:
	$(INSTALL) -d $(bindir)
	$(INSTALL) xplanet $(bindir)
	$(INSTALL) xplanetbg $(bindir)
	$(INSTALL) -m 755 tkxplanet $(bindir)
	$(INSTALL) -d $(mandir)
	$(INSTALL) -d $(mandir)/man1
	$(INSTALL) -m 644 xplanet.1 $(mandir)/man1
	$(INSTALL) -m 644 xplanetbg.1 $(mandir)/man1
	$(INSTALL) -d $(auxdir)
ifneq ($(AUXDIR),)
	$(INSTALL) -m 644 $(addprefix auxdir/,$(AUXDIR)) $(auxdir)
endif

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

uninstall:
	$(RM) $(bindir)/xplanet
	$(RM) $(bindir)/xplanetbg
	$(RM) $(bindir)/tkxplanet
	$(RM) $(mandir)/man1/xplanet.1
	$(RM) $(mandir)/man1/xplanetbg.1
ifneq ($(AUXDIR),)
	$(RM) $(addprefix $(auxdir)/, $(AUXDIR))
endif

dist: 	
	$(INSTALL) -d $(distdir)
	$(CP) BUGS COPYING CREDITS ChangeLog INSTALL Makefile* README *.cc \
	*.h *.h.in tkxplanet* aclocal.m4 configure* *.1 $(distdir)
	$(CP) -r autoconf $(distdir)
ifneq ($(AUXDIR),)
	$(INSTALL) -d $(distdir)/auxdir
	$(CP) -r auxdir/*.txt $(distdir)/auxdir	
endif
	$(TAR) cf $(distdir).tar $(distdir)
	$(GZIP) -9 $(distdir).tar
	$(RM) -fr $(distdir)

clean:
	$(RM) *.o 

distclean:
	$(RM) *.o auxfiles.h checkfuncs.h xplanet xplanetbg config.* \
	tkxplanet Makefile
