##########################################################################
##########################################################################
#
# Main makefile for the Linux driver for Eagle-based USB ADSL Modems
#
##########################################################################
##########################################################################

-include Makefile.common

ROOTMSGINST="Vous devez tre sous le compte root pour l'installation !"
ROOTMSGUNINST="Vous devez tre sous le compte root pour dsinstaller le driver !"

all: build

build:
	make -C driver && \
	make -C pppoa

eagleconfig:

install:
	@if [ `id -ur` != 0 ]; then       \
		echo $(ROOTMSGINST);      \
	else                              \
		make -C driver install &&  \
		make -C pppoa install ; \
	fi

uninstall:
	@if [ `id -ur` != 0 ]; then \
		echo $(ROOTMSGUNINST); \
	else \
		make -C driver uninstall && \
		make -C pppoa uninstall ; \
	fi

clean:
	make -C driver clean && \
	make -C pppoa clean 

distclean: clean
	rm -f Makefile.common utils/eagleconfig/Makefile confdefs.h
	rm -rf config.{status,log,cache}

maintainer-clean: distclean
	rm -f configure aclocal.m4

.PHONY: install uninstall clean distclean maintainer-clean build all eagleconfig
