SRC = ez-ipupdate-3.0.11b7
TARGETS = $(SRC)/src/ez-ipupdate

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

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

$(SRC)/.configured:
	cd $(SRC) \
		&& LDFLAGS='-s' CFLAGS='-Os' ./configure \
                        --prefix=$(PREFIX) \
                        --target=$(TARGET_TYPE) \
                        --host=$(HOST_TYPE) \
                        --build=$(BUILD_TYPE) \
			--disable-nls
	touch $(SRC)/.configured

USR_SBIN := $(SHADOW-DIR)/usr/sbin

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

install: $(TARGETS)
	$(INSTALL) -d $(USR_SBIN)
	$(INSTALL) $(SRC)/ez-ipupdate $(USR_SBIN)

dist_install: $(TARGETS)
	$(INSTALL) -d $(PREFIX)/usr/bin
	$(INSTALL) $(SRC)/ez-ipupdate $(PREFIX)/usr/bin
