SRC=libdaemon-0.12
TARGETS = $(SRC)/libdaemon/.libs/libdaemon.*

.PHONY: all clean distclean install dist_install
all: 
clean:
	make -C $(SRC) clean
	rm -f $(SRC)/.configured

distclean:
	-make -C $(SRC) distclean
	rm -f $(SRC)/.configured

$(SRC)/.configured:
	cd $(SRC) \
		&& INSTALL="/usr/bin/install -p" LDFLAGS='-s' CFLAGS='-Os' ./configure \
                        --prefix=$(PREFIX) \
                        --target=$(TARGETS_TYPE) \
                        --host=$(HOST_TYPE) \
                        --build=$(BUILD_TYPE) \
			--disable-shared \
			--disable-lynx
	touch $(SRC)/.configured

$(TARGETS): $(SRC)/.configured
	$(MAKE) -C $(SRC)

install: $(TARGETS)
	$(MAKE) -C $(SRC) install-strip

dist_install: $(TARGETS)
	$(MAKE) -C $(SRC) install-strip
