SOURCE=rp-pppoe-3.8/src
TARGET=arm-linux
#TARGET=mipsel-linux-uclibc

.PHONY: all clean distclean openSource install
all: openSource
clean:
	make -C $(SOURCE) clean

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

openSource: $(SOURCE)/.configured
	make CC=$(TARGET)-gcc AR=$(TARGET)-ar RANLIB=$(TARGET)-ranlib \
             -C $(SOURCE)

$(SOURCE)/.configured:
	cd $(SOURCE) \
		&& LDFLAGS='-s' CFLAGS='-Os' ./configure \
			--target=$(TARGET) \
			--host=$(TARGET) \
			--disable-nls
	touch $(SOURCE)/.configured

install: $(SOURCE)/.configured
	make -C $(SOURCE) install-strip
