
# List of sources
SRCS = example_1.c example_2.c example_4.c
MSRCS= visual.c misc.c cache.c menu.c history.c

# List of object files
OBJS = example_1.o example_2.o example_4.o
MOBJS= visual.o misc.o cache.o menu.o history.o

# Targets to make
EXAMPLES=example_1 example_2 example_4

# The XmHTML library
XMHTMLLIB = -L../lib -lXmHTML

# Richard Offer's http client-side library
HTTPLIB   = -L../http -lhttp

# Libraries against which all examples are linked 
LINKLIBS = $(XMHTMLLIB) $(LOADLIBES) $(DMALLOCLIB)

# rule to create .o files from .c files 
.c.o:
	$(RM) $@
	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $<

all: $(EXAMPLES)

# targets to build

example_1::  ../src/libXmHTML.a example_1.o
	$(RM) $@ \ 
	$(CC) -o $@ $(LDFLAGS) example_1.o $(LINKLIBS)

example_2::  ../src/libXmHTML.a example_2.o $(MOBJS)
	$(RM) $@ \ 
	$(CC) -o $@ $(LDFLAGS) example_2.o $(MOBJS) $(LINKLIBS)

example_4::  ../src/libXmHTML.a example_4.o
	$(RM) $@ \ 
	$(CC) -o $@ $(LDFLAGS) example_4.o $(LINKLIBS) $(HTTPLIB)

.PHONY: ../src/libXmHTML.a 
.PHONY: stamp-includes

includes:: stamp-includes

depend:: $(SRCS) $(MSRCS)
	$(MAKEDEPEND) $(INCLUDES) $(CPPFLAGS) $(SRCS) $(MSRCS)

clean::
	$(RM) $(OBJS) $(MOBJS) 
	$(RM) $(EXAMPLES)

distclean:: clean 
	$(RM) core *.out *.log make.world *.bak *.last *.auto *.rej *.orig
	#$(CP) Makefile.org Makefile

#--------------------------------------------------------------------------
# don't delete anything below this line, makedepend depends on it
#--------------------------------------------------------------------------
