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


OBJS = HWPrinter.o     \
       Graphic.o 

all:libHWPrinter.so

%.o:%.c
	$(CC) -c $< -o $@ -I ./ -I ./libusb/include -L./libusb -lusb-1.0 "-fno-stack-protector" -fPIC
	
libHWPrinter.so:$(OBJS)
	$(CC) $(OBJS) -o libHWPrinter.so -L./libusb -lusb-1.0 -fPIC -shared "-fno-stack-protector"
	$(STRIP) libHWPrinter.so
clean:
	rm -rf libHWPrinter.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" -Wl,-rpath,./ -I ./libusb/include -I ./ testMain.c -L./ -lHWPrinter -L./libusb -lusb-1.0
	
cpcldemo:
	$(CC) -o cpcldemo  "-fno-stack-protector" -Wl,-rpath,./ -I ./libusb/include -I ./ CPCLDemo.c -L./ -lHWPrinter -L./libusb -lusb-1.0

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