#compiler flags: -Wall Warnings all, -g gdb debug markings, CFLAGS=-Wall -O INCLUDE= -I ./include -I ../shared WINLIB= -L ./winlib LIBUSB= -lusb-1.0 CC= gcc SOURCES=$(wildcard source/*.c source/lua/*.c) OBJECTS=$(patsubst %.c,%.o,$(SOURCES)) LUAOBJ=$(wildcard source/lua/*.o) TARGET=inlretro #default to windows build all: $(CC) $(INCLUDE) $(LUAOBJ) $(SOURCES) -o $(TARGET) $(WINLIB) $(CFLAGS) $(LIBUSB) #unix build doesn't need winlib directory as libusb should be installed on OS. #sudo apt-get install libusb-1.0-0-dev unix: $(CC) $(INCLUDE) $(LUAOBJ) $(SOURCES) -o $(TARGET) $(CFLAGS) -lm $(LIBUSB) # "make debug" will build program with debug print messages # -DDEBUG show debug logs # -g build with gdb debug tags debug: CFLAGS += -DDEBUG -g debug: all #unix debug build unixdebug: CFLAGS += -DDEBUG -g unixdebug: unix #clean on unix and windows(.exe) clean: rm -f $(TARGET) $(TARGET).exe $(OBJECTS) $(LUAOBJ)