CROSS = 
CC		= $(CROSS)gcc
STRIP   = $(CROSS)strip
HOSTCC  = gcc
HOSTSTRIP = strip


OBJS = HWISPRTPrinter.o     \
       sprtGraphic.o 

all:libHWISPRTPrinter.so

%.o:%.c
	$(CC) -c $< -o $@ -I ./ -I ./libusb/include -L./libusb -lusb-1.0 "-fno-stack-protector" -fPIC
	
libHWISPRTPrinter.so:$(OBJS)
	$(CC) $(OBJS) -o libHWISPRTPrinter.so -fPIC -shared "-fno-stack-protector"
	$(STRIP) libHWISPRTPrinter.so
clean:
	rm -rf libHWISPRTPrinter.so
	rm -rf *.o
	rm -rf testMain
	rm -rf GtestMain
	rm -rf CPCLtest
	rm -rf TSPLtest
	rm -rf cpcldemo
test:
	$(CC) -o testMain  "-fno-stack-protector" -I ./libusb/include -I ./ testMain.c -L./ -lHWISPRTPrinter -L./libusb -lusb-1.0
	
cpcldemo:
	$(CC) -o cpcldemo  "-fno-stack-protector" -I ./libusb/include -I ./ CPCLDemo.c -L./ -lHWISPRTPrinter -L./libusb -lusb-1.0

gets:
	$(CC) -o GtestMain  "-fno-stack-protector" -I ./libusb/include -I ./ GtestMain.c -L./ -lHWISPRTPrinter -L./libusb -lusb-1.0
	
tspl:
	$(CC) -o TSPLtest  "-fno-stack-protector" -I ./libusb/include -I ./ TSPLtest.c -L./ -lHWISPRTPrinter -L./libusb -lusb-1.0
	
cpcltest:
	$(CC) -o CPCLtest  "-fno-stack-protector" -I ./libusb/include -I ./ CPCLtest.c -L./ -lHWISPRTPrinter -L./libusb -lusb-1.0
	
