#------------------------------------------
# Makefile
#
# Makefile for eaglectrl
#

include ../../Makefile.common

CFLAGS=-O2 -pipe -Wall -pedantic -DLINUX -g -DCONF_DIR="\"$(EAGLEUSB_CONFDIR)\"" -DBIN_DIR="\"$(EAGLEUSB_BINDIR)\""
INSTALLDIR=$(SBINDIR)

all: eaglectrl

eaglectrl : eaglectrl.c ../eagle-usb.h
	gcc $(CFLAGS) $< -o $@

install : eaglectrl eagle-usb.conf
	mkdir -p $(INSTALLDIR)
	mkdir -p $(EAGLEUSB_CONFDIR)
	$(INSTALL) -m 0755 -o root -g root eaglectrl $(INSTALLDIR)
	$(INSTALL) -m 0755 -o root -g root eaglestat $(INSTALLDIR)
	$(INSTALL) -m 0644 -o root -g root eagle-usb.conf $(EAGLEUSB_CONFDIR)/eagle-usb.conf
#	$(INSTALL) -m 0755 -o root -g root CMVep.txt $(CONFIGDIR)/
#	$(INSTALL) -m 0755 -o root -g root CMVei.txt $(CONFIGDIR)/

uninstall:
	rm -f $(INSTALLDIR)/eaglectrl
	rm -f $(INSTALLDIR)/eaglestat
	rm -f $(EAGLEUSB_CONFDIR)/eagle-usb.conf
#	rm -f $(EAGLEUSB_CONFDIR)/CMVep.txt
#	rm -f $(EAGLEUSB_CONFDIR)/CMVei.txt



clean :
	rm -f eaglectrl

