##########################################################################
##########################################################################
#
# Main makefile for the Linux driver for the Sagem F@st 800 USB AdSL modem
#
##########################################################################
##########################################################################

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 && \
	make -C scripts

install:
	@if [ `id -ur` != 0 ]; then       \
		echo $(ROOTMSGINST);      \
	else                              \
		scripts/distrib/execScript beforeInstall && \
		make -C driver install &&  \
		make -C pppoa install &&   \
		make -C scripts install && \
		scripts/distrib/execScript afterInstall && \
		echo "################################################################" && \
		cat scripts/message && \
		rm -f scripts/message ; \
	fi

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


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

