# Last resort makefile for building XTide.  Use this only if your Imake
# is broken.
# DWF  1998-04-11

# Compiler and basic flags
# Add any -D that you think are necessary to CXXFLAGS
CXX = c++
CXXFLAGS = -O2 -c
LDFLAGS = -s -o

# Root of X11 tree
XROOT = /usr/X11R6
# XROOT = /usr/openwin

# Include all relevant include directories
INCDIRS = -I$(XROOT)/include

# Include all relevant library directories
LIBDIRS = -L$(XROOT)/lib

# Uncomment these only if you are on a Solaris machine
# EXTRALIBS = -lsocket -lnsl

# Some of these might need to go away if you are running a version older
# than X11R6 (namely SM and ICE).  XTide isn't tested with such versions,
# but if it works with Openwin...
XLIBS = -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11

include manifest

all: $(PROGRAMS)

clean:
	rm $(PROGRAMS) *.o

# Catch-all dependency line.
$(ALLOBJS): $(ALLSRCS) $(ALLHDRS)

xtide: $(OBJS1)
	$(CXX) $(LIBDIRS) $(LDFLAGS) xtide $(OBJS1) $(XLIBS) -lXpm $(EXTRALIBS) -lpng -lz -lm 

xttpd: $(OBJS2)
	$(CXX) $(LIBDIRS) $(LDFLAGS) xttpd $(OBJS2) $(EXTRALIBS) -lpng -lz -lm

tide: $(OBJS3)
	$(CXX) $(LIBDIRS) $(LDFLAGS) tide $(OBJS3) $(EXTRALIBS) -lpng -lz -lm

.cc.o:
	$(CXX) $(INCDIRS) $(CXXFLAGS) $<
