From e49ff6d2d0645f130277a470fd6488e03b709c4a Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 21 Dec 2018 03:30:13 +0000 Subject: [PATCH] Fix osx target -> machos --- host/Makefile | 116 +++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/host/Makefile b/host/Makefile index b25d43a..23b6629 100644 --- a/host/Makefile +++ b/host/Makefile @@ -1,58 +1,58 @@ -#compiler flags: -Wall Warnings all, -g gdb debug markings, -CFLAGS=-Wall -O -LDFLAGS= -llua -lusb-1.0 -Lsource/lua -INCLUDE= -I ./include -I ../shared -LDFLAGS_WINDOWS= -L ./winlib $(LDFLAGS) -LDFLAGS_UNIX= -lm $(LDFLAGS) -CC= gcc - -SOURCES=$(wildcard source/*.c) -OBJECTS=$(SOURCES:.c=.o) - -# Use GCC preprocessor to determine dependencies for all source files. -DEPS=$(OBJECTS:.o=.d) -%.d: %.c - @$(CC) $(CFLAGS) $(INCLUDE) $< -MM -MT $(@:.d=.o) >$@ -# Include generated .d Makefile fragments to manage object dependencies. --include $(DEPS) - -# Provide recipes for building all objects, dependencies managed via earlier inclusion. -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $< - -.PHONY: clean linux osx - -# TODO: Pass through platform when building liblua. -liblua: - $(MAKE) -C source/lua a - -TARGET=inlretro - -#default to windows build -all: liblua $(DEPS) $(OBJECTS) - $(CC) $(INCLUDE) $(OBJECTS) -o $(TARGET) $(CFLAGS) $(LDFLAGS_WINDOWS) - -#unix build doesn't need winlib directory as libusb should be installed on OS. -#sudo apt-get install libusb-1.0-0-dev -unix: liblua $(DEPS) $(OBJECTS) - $(CC) $(INCLUDE) $(OBJECTS) -o $(TARGET) $(CFLAGS) $(LDFLAGS_UNIX) - -# Convienience in case its not clear Unix really means not-Windows. -linux: unix -macosx: unix - -# "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: - $(MAKE) -C source/lua clean - rm -f $(TARGET) $(TARGET).exe $(OBJECTS) $(DEPS) $(LUAOBJ) source/lua/liblua.a +#compiler flags: -Wall Warnings all, -g gdb debug markings, +CFLAGS=-Wall -O +LDFLAGS= -llua -lusb-1.0 -Lsource/lua +INCLUDE= -I ./include -I ../shared +LDFLAGS_WINDOWS= -L ./winlib $(LDFLAGS) +LDFLAGS_UNIX= -lm $(LDFLAGS) +CC= gcc + +SOURCES=$(wildcard source/*.c) +OBJECTS=$(SOURCES:.c=.o) + +# Use GCC preprocessor to determine dependencies for all source files. +DEPS=$(OBJECTS:.o=.d) +%.d: %.c + @$(CC) $(CFLAGS) $(INCLUDE) $< -MM -MT $(@:.d=.o) >$@ +# Include generated .d Makefile fragments to manage object dependencies. +-include $(DEPS) + +# Provide recipes for building all objects, dependencies managed via earlier inclusion. +%.o: %.c + $(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $< + +.PHONY: clean linux macosx + +# TODO: Pass through platform when building liblua. +liblua: + $(MAKE) -C source/lua a + +TARGET=inlretro + +#default to windows build +all: liblua $(DEPS) $(OBJECTS) + $(CC) $(INCLUDE) $(OBJECTS) -o $(TARGET) $(CFLAGS) $(LDFLAGS_WINDOWS) + +#unix build doesn't need winlib directory as libusb should be installed on OS. +#sudo apt-get install libusb-1.0-0-dev +unix: liblua $(DEPS) $(OBJECTS) + $(CC) $(INCLUDE) $(OBJECTS) -o $(TARGET) $(CFLAGS) $(LDFLAGS_UNIX) + +# Convienience in case its not clear Unix really means not-Windows. +linux: unix +macosx: unix + +# "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: + $(MAKE) -C source/lua clean + rm -f $(TARGET) $(TARGET).exe $(OBJECTS) $(DEPS) $(LUAOBJ) source/lua/liblua.a