PROG        = usb_modeswitch
PROG_EP0    = EP0_Switch_Utility
PROG_ZERO   = ozerocdoff

VERS        = 0.9.6
#STRIP	    = strip
#CC          = gcc
STRIP=/opt/buildroot-gcc342/bin/mipsel-linux-strip
CC=/opt/buildroot-gcc342/bin/mipsel-linux-gcc
#CCFLAGS     = -l usb
RM          = /bin/rm -f
OBJS        = usb_modeswitch.c
OBJS_EPO    = EP0_Switch_Utility.c
OBJS_ZERO   = ozerocdoff.c
PREFIX	    = $(DESTDIR)/usr
ETCDIR	    = $(DESTDIR)/etc
SBINDIR	    = $(PREFIX)/sbin

.PHONY:     clean
all:        $(PROG) $(PROG_EP0) $(PROG_ZERO)
$(PROG):    $(OBJS)
#	      $(CC) $(CCFLAGS) -o $(PROG) $(OBJS)
	$(CC) -static -o  $(PROG) $(OBJS) libusb.a
	$(STRIP) $(PROG)

$(PROG_EP0):
	$(CC) -static -o  $(PROG_EP0) $(OBJS_EPO) libusb.a
	$(STRIP) $(PROG_EP0)
	
$(PROG_ZERO):
	$(CC) -static -o  $(PROG_ZERO) $(OBJS_ZERO) libusb.a
	$(STRIP) $(PROG_ZERO)
	
clean:
				$(RM) -fr ./*.o
	      $(RM) ./usb_modeswitch
				$(RM) ./EP0_Switch_Utility
				$(RM) ./ozerocdoff
				
romfs:

	$(ROMFSINST) /bin/$(PROG)
	$(ROMFSINST) /bin/$(PROG_EP0)
	$(ROMFSINST) /bin/$(PROG_ZERO)

