Blame | Last modification | View Log | Download
## Makefile for OpenzWave Mac OS X applications# Greg Satz# GNU make only# requires libudev-dev.SUFFIXES: .d .cpp .o .a.PHONY: default cleanDEBUG_CFLAGS := -Wall -Wno-format -ggdb -DDEBUG $(CPPFLAGS) -std=c++11RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 $(CPPFLAGS) -std=c++11DEBUG_LDFLAGS := -gtop_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../../)#where is put the temporary libraryLIBDIR ?= $(top_builddir)INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/LIBS = $(wildcard $(LIBDIR)/*.so $(LIBDIR)/*.dylib $(top_builddir)/cpp/build/*.so $(top_builddir)/cpp/build/*.dylib )LIBSDIR = $(abspath $(dir $(firstword $(LIBS))))minozwsrc := $(notdir $(wildcard $(top_srcdir)/cpp/examples/MinOZW/*.cpp))VPATH := $(top_srcdir)/cpp/examples/MinOZWtop_builddir ?= $(CURDIR)default: $(top_builddir)/MinOZWinclude $(top_srcdir)/cpp/build/support.mk-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(minozwsrc))#if we are on a Mac, add these flags and libs to the compile and link phasesifeq ($(UNAME),Darwin)CFLAGS += -DDARWINifeq ($(DARWIN_MOJAVE_UP),1)# Newer macOS releases don't support i386 so only build 64-bitTARCH += -arch x86_64else# Support older versions of OSX that may need to build both 32-bit and 64-bitTARCH += -arch i386 -arch x86_64endifendif# Dup from main makefile, but that is not included when building here..ifeq ($(UNAME),FreeBSD)LDFLAGS+= -lusbifeq ($(shell test $$(uname -U) -ge 1002000; echo $$?),1)ifeq (,$(wildcard /usr/local/include/iconv.h))$(error FreeBSD pre 10.2: Please install libiconv from ports)elseCFLAGS += -I/usr/local/includeLDFLAGS+= -L/usr/local/lib -liconvendifendifelse ifeq ($(UNAME),NetBSD)LDFLAGS+= -L/usr/pkg/lib -lusb-1.0else ifeq ($(UNAME),SunOS)LDFLAGS+= -lusb-1.0endif$(OBJDIR)/MinOZW: $(patsubst %.cpp,$(OBJDIR)/%.o,$(minozwsrc))@echo "Linking MinOZW"@$(LD) $(LDFLAGS) $(TARCH) -o $@ $< $(LIBS) -pthread$(top_builddir)/MinOZW: $(top_srcdir)/cpp/examples/MinOZW/MinOZW.in $(OBJDIR)/MinOZW@echo "Creating Temporary Shell Launch Script"@$(SED) \-e 's|[@]LDPATH@|$(LIBSDIR)|g' \< "$<" > "$@"@chmod +x $(top_builddir)/MinOZWclean:@rm -rf $(DEPDIR) $(OBJDIR) $(top_builddir)/MinOZWifeq ($(XMLLINT),)xmltest: $(XMLLINT)$(error xmllint command not found.)elsexmltest: $(XMLLINT)@$(XMLLINT) --noout --schema ../../../config/zwcfg.xsd zwcfg_*.xml@$(XMLLINT) --noout --schema ../../../config/zwscene.xsd zwscene.xmlendifinstall: $(OBJDIR)/MinOZW@echo "Installing into Prefix: $(PREFIX)"@install -d $(DESTDIR)/$(PREFIX)/bin/@cp $(OBJDIR)/MinOZW $(DESTDIR)/$(PREFIX)/bin/MinOZW@chmod 755 $(DESTDIR)/$(PREFIX)/bin/MinOZW