Makefile 1010 Bytes
BIN = bin
OBJ = obj
SRC = src
INCLUDE = include
CFLAGS =
CLIBS = -lusb-1.0 -I"C:\Program Files\zLib\libusb-1.0.23\include" -B"C:\Program Files\zLib\libusb-1.0.23\MinGW32\static"
GNUMAKEFLAGS = --no-print-directory

gcc = gcc
gcc := "/mnt/c/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe"


VERBOSE_THRESHOLD?=3

RELEASE?=0
ifeq ($(RELEASE), 1)
	CFLAGS = -W -Wall
	VERBOSE_THRESHOLD = 0
else
	CFLAGS = -W -Wall -g -O0
endif



all : main


version :
	${gcc} -v

main : libusb_wrapper ${SRC}/main.c
	${gcc} -o ${OBJ}/$@.o -c ${SRC}/$@.c -I ${INCLUDE} ${CLIBS} ${CFLAGS}
	${gcc} -o ${BIN}/$@.exe ${OBJ}/main.o ${OBJ}/libusb_wrapper.o ${CFLAGS} ${CLIBS}

demostep : main
	${BIN}/main.exe demo4.1

libs: libusb_wrapper

libusb_wrapper: obj ${SRC}/libusb_wrapper.c ${INCLUDE}/libusb_wrapper.h
	${gcc} -o ${OBJ}/$@.o -c ${SRC}/$@.c -I ${INCLUDE} ${CLIBS} ${CFLAGS}



obj :
	@-mkdir ${OBJ}

bin :
	@-mkdir ${BIN}

clean :
	rm -rf obj/*.o

mrproper: clean
	rm -rf bin
	rm -rf obj