#
# Makefile for various contributed libTw clients
#

#
# list of subdirectories to build
#
SUBDIRS=twcd

#
# add your binary here
#
BINS=
MODS=
SHLIBS=
ARLIBS=
CLLIBS=

# place the object files for your binary here: you must add a line
# OBJS_<your binary>=<list of object files>
#
# example:
# OBJS_twbiff=biff.o


#
# --------------- no user-serviceable parts below this line ----------------
#
TOPDIR=..
THISDIR=$(TOPDIR)/contrib

-include $(TOPDIR)/makeautoconf

LD_FLAGS+=$(LD_LIBTW)

ALLBINS=$(BINS) $(MODS) $(SHLIBS) $(ARLIBS) $(CLLIBS)

all: build-all


-include $(TOPDIR)/conf/conf.current
-include .modules
-include .depend
-include $(TOPDIR)/.hdepend

#
# include the do-everything file.
# Must correctly set all CC_FLAGS* and LD_FLAGS* before including this!
#
include $(TOPDIR)/makerules


ifneq ($(CONF_SOCKET),n)
  build-all: $(ALLBINS) build-subdirs
else
  build-all:
	@echo ; \
	 echo "You disabled \"Support remote socket connections\"," ; \
	 echo "so the clients will NOT be compiled!" ; \
	 echo
endif




install:
	$(INSTALL-DIR) $(DESTDIR)$(bindir)
	$(INSTALL) $(BINS) $(DESTDIR)$(bindir)

uninstall:
	cd $(DESTDIR)$(bindir) && \
	   rm -f $(BINS) || true
	rmdir $(DESTDIR)$(bindir) || true

clean:
	rm -f .*.flags .*.bin .*.mod .*.shlib .*.arlib .*.cllib gmon.out core \
		$(ALLBINS) *.la *.a *.o *.lo *.so *.so.* ; \
	rm -fr .libs

distclean: clean
	rm -f `find . -type l` `find . -name .modules -o -name .depend`

