| BINDIR=$(DESTDIR)/usr/bin |
| APPDIR=$(DESTDIR)/app/client |
| LIBDIR=$(DESTDIR)/usr/lib |
| |
| ifndef NEXUS_TOP |
| $(error NEXUS_TOP is not defined) |
| endif |
| |
| BCHP_VER=1 |
| PLATFORM=97425 |
| |
| # nexus uses C89 by default for higher compatibility |
| NEXUS_C_STD=c99 |
| |
| # include cross-compiler definitions |
| include $(NEXUS_TOP)/platforms/$(PLATFORM)/build/platform_app.inc |
| |
| LIBFLAGS += -lpthread -ldl -lm -lrt |
| |
| LIBFLAGS += -L./ |
| |
| INCFLAGS += -I$(MAGNUM)/../rockford/middleware/v3d/interface/khronos/include/ \ |
| -I$(MAGNUM)/../rockford/middleware/platform/nexus \ |
| -I$(BSEAV)/lib/playbackdevice/nexusMgr |
| |
| .PHONY: clean |
| |
| all: probe |
| @echo $(NEXUS_TOP) |
| |
| ifdef DEBUG |
| B_REFSW_DEBUG ?= $(DEBUG) |
| endif |
| |
| ifeq ($(B_REFSW_DEBUG),) |
| B_REFSW_DEBUG = y |
| endif |
| |
| ifeq ($(B_REFSW_DEBUG),y) |
| V3D_LIB := lib_$(PLATFORM)_debug |
| else |
| V3D_LIB := lib_$(PLATFORM)_release |
| endif |
| |
| ifeq ($(NEXUS_MODE),) |
| CFLAGS += -DSINGLE_PROCESS |
| endif |
| |
| ifeq ($(NEXUS_MODE),client) |
| CFLAGS += -DUSER_MODE_MULTIPROC_CLIENT |
| endif |
| |
| ifeq ($(PLATFORM),97425) |
| CFLAGS += -DENCODER_ENABLED |
| endif |
| |
| # "unused parameter" is a pretty useless warning |
| CFLAGS += -Wno-unused-parameter |
| CXXFLAGS += -Wno-unused-parameter |
| |
| # "missing initializer" is sometimes useful, but seemingly not in OpenGL where |
| # there are often uninitialized fields. |
| CFLAGS += -Wno-missing-field-initializers |
| CXXFLAGS += -Wno-missing-field-initializers |
| |
| # All warnings are errors, so we aren't tempted to let them sit unfixed. |
| CFLAGS += -Werror |
| CXXFLAGS += -Werror |
| |
| # C++ standard |
| CXXFLAGS += -std=c++0x |
| |
| # For linux builds, link to the correct libraries |
| ifneq ($(findstring linux,$(B_REFSW_OS)),) |
| LDFLAGS := -lnexus$(NEXUS_LIB_SUFFIX) -L${NEXUS_BIN_DIR} -lpthread \ |
| -L$(NEXUS_TOP)/../rockford/middleware/v3d/$(V3D_LIB) -lv3ddriver \ |
| -L$(NEXUS_TOP)/../rockford/middleware/platform/nexus/$(V3D_LIB) -lnxpl -lprojectM |
| endif |
| |
| clean: |
| rm -f *.o probe |
| rm -f *.c~ *.h~ |
| |
| # This is the minimum needed to compile and link with Nexus |
| CFLAGS += -DGLES2 -DGLNEXUS $(INCFLAGS) $(NEXUS_CFLAGS) \ |
| $(addprefix -I,$(NEXUS_APP_INCLUDE_PATHS)) \ |
| $(addprefix -D,$(NEXUS_APP_DEFINES)) |
| CXXFLAGS += -DGLES2 -DGLNEXUS $(INCFLAGS) $(NEXUS_CFLAGS) \ |
| $(addprefix -I,$(NEXUS_APP_INCLUDE_PATHS)) \ |
| $(addprefix -D,$(NEXUS_APP_DEFINES)) |
| |
| # Remove flags that don't apply to C++ |
| CXXFLAGS := $(filter-out -Wstrict-prototypes -std=c99, $(CXXFLAGS) ) |
| |
| # Until we replace code in wvhelper |
| CXXFLAGS += -Wno-deprecated |
| |
| LDFLAGS += $(LIBFLAGS) -ljpeg -lpng14 -lz -ltiff -lungif -lstacktrace |
| |
| # Always build with debug |
| CFLAGS += -g -Os |
| CXXFLAGS += -g -Os |
| LDFLAGS += -rdynamic |
| |
| # lame autodepends: all .o files depend on all .h files |
| $(patsubst %.c,%.o,$(wildcard *.c) $(wildcard */*.c)): \ |
| $(wildcard *.h) $(wildcard */*.h) |
| |
| OBJS := probe.o |
| |
| %.o: %.c |
| @echo "[$< -> $@]" |
| $(Q_)$(CC) -fPIC $(CPPFLAGS) $(CFLAGS) -o $@ -c $< |
| |
| %.o: %.cpp |
| @echo "[$< -> $@]" |
| $(Q_)$(CXX) -fPIC $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $< |
| |
| probe: $(OBJS) $(VXOBJS) |
| @echo "[$^ -> $@]" |
| @echo NEXUS_APP_INCLUDE_PATHS are $(NEXUS_APP_INCLUDE_PATHS) |
| $(Q_)$(CXX) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS) |
| |
| # implicit rule for building typical binaries |
| #%: BRCM/%.o |
| # @echo "[$^ -> $@]" |
| # @echo NEXUS_APP_INCLUDE_PATHS are $(NEXUS_APP_INCLUDE_PATHS) |
| # $(Q_)$(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS) |
| |
| install: all |
| mkdir -p $(BINDIR) $(APPDIR) |
| cp probe $(APPDIR) |