host_bios: Cleanup makefiles
[processor-sdk/big-data-ipc-examples.git] / host_bios / simple_buffer_example / host / makefile
index 4c1626e584047768507290362bb9206f6bb681c8..33988c103a85078b7c8bf204fbe1b9c0634e5ecb 100644 (file)
@@ -38,13 +38,20 @@ EXBASE = ..
 include $(EXBASE)/products.mak
 
 srcs = MainHost.c App.c
-objs = $(addprefix bin/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg,$(srcs)))
-CONFIG = bin/$(PLATFORM)/$(PROFILE)/configuro
+objs = $(addprefix bin/$(BOARD_NAME)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg,$(srcs)))
+CONFIG = bin/$(BOARD_NAME)/$(PROFILE)/configuro
 
--include $(addprefix bin/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg.dep,$(srcs)))
+HOSTOS = bios
+locallibsrcs = shared/bigdataxlat/bios/bigdataxlat.c
+locallibobjs = $(addprefix bin/shared/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg,$(locallibsrcs)))
+
+-include $(addprefix bin/$(BOARD_NAME)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg.dep,$(srcs)))
+-include $(addprefix bin/shared/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oa15fg.dep,$(locallibsrcs)))
 
 .PRECIOUS: %/compiler.opt %/linker.cmd
 
+.PHONY: release debug install install_rov
+
 all: release
 #all: debug
 
@@ -54,14 +61,19 @@ release:
 debug:
        $(MAKE) PROFILE=debug app_host.x
 
-app_host.x: bin/$(PLATFORM)/$(PROFILE)/app_host.xa15fg
-bin/$(PLATFORM)/$(PROFILE)/app_host.xa15fg: $(objs) $(libs) $(CONFIG)/linker.cmd
+app_host.x: bin/$(BOARD_NAME)/$(PROFILE)/app_host.xa15fg
+bin/$(BOARD_NAME)/$(PROFILE)/app_host.xa15fg: $(objs) $(locallibobjs) $(libs) $(CONFIG)/linker.cmd
        @$(ECHO) "#"
        @$(ECHO) "# Making $@ ..."
-       $(LD) -o $@ $(LDFLAGS) $(objs) $(libs) -Wl,-T,$(CONFIG)/linker.cmd \
+       $(LD) -o $@ $(LDFLAGS) $(objs) $(locallibobjs) $(libs) -Wl,-T,$(CONFIG)/linker.cmd \
                -lgcc -lc -lm -lnosys $(LDLIBS)
 
-bin/$(PLATFORM)/$(PROFILE)/obj/%.oa15fg: %.c $(CONFIG)/compiler.opt
+bin/$(BOARD_NAME)/$(PROFILE)/obj/%.oa15fg: %.c $(CONFIG)/compiler.opt
+       @$(ECHO) "#"
+       @$(ECHO) "# Making $@ ..."
+       $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+bin/shared/$(PLATFORM)/$(PROFILE)/obj/%.oa15fg: ../%.c $(CONFIG)/compiler.opt
        @$(ECHO) "#"
        @$(ECHO) "# Making $@ ..."
        $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
@@ -90,7 +102,13 @@ install:
 #      @$(MKDIR) $(EXEC_DIR)/debug
 #      $(CP) bin/$(PLATFORM)/debug/app_host.xa15fg $(EXEC_DIR)/debug
        @$(MKDIR) $(EXEC_DIR)/release
-       $(CP) bin/$(PLATFORM)/release/app_host.xa15fg $(EXEC_DIR)/release
+       $(CP) bin/$(BOARD_NAME)/release/app_host.xa15fg $(EXEC_DIR)/release
+
+install_rov:
+       @$(ECHO) "#"
+       @$(ECHO) "# Making $@ ..."
+       @$(MKDIR) $(EXEC_DIR)/release
+       $(CP) bin/$(BOARD_NAME)/release/configuro/package/cfg/Host_pa15fg.rov.xs $(EXEC_DIR)/release
 
 help:
        @$(ECHO) "make                   # build executable"
@@ -118,6 +136,7 @@ LD = $(gnu.targets.arm.A15F)/bin/arm-none-eabi-gcc
 
 CPPFLAGS = -Dfar= -D__DYNAMIC_REENT__
 CFLAGS = -Wall -Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections $(CCPROFILE_$(PROFILE)) @$(CONFIG)/compiler.opt -I.
+CFLAGS += -I../shared/bigdataxlat/bios
 CFLAGS += -DSERVER=\"$(SERVER)\" -DPLATFORM_$(PLATFORM)
 
 LDFLAGS = $(LDPROFILE_$(PROFILE)) -mfloat-abi=hard -nostartfiles -Wl,-static -Wl,--gc-sections -Wl,-Map=$(@D)/obj/$(@F).map
@@ -149,8 +168,11 @@ endif
 #  ======== create output directories ========
 ifneq (clean,$(MAKECMDGOALS))
 ifneq (,$(PROFILE))
-ifeq (,$(wildcard bin/$(PROFILE)/obj))
-    $(shell $(MKDIR) -p bin/$(PLATFORM)/$(PROFILE)/obj)
+ifeq (,$(wildcard bin/$(BOARD_NAME)/$(PROFILE)/obj))
+    $(shell $(MKDIR) -p bin/$(BOARD_NAME)/$(PROFILE)/obj)
+endif
+ifeq (,$(wildcard bin/shared/$(PLATFORM)/$(PROFILE)/obj/shared/bigdataxlat/bios))
+    $(shell $(MKDIR) -p bin/shared/$(PLATFORM)/$(PROFILE)/obj/shared/bigdataxlat/bios)
 endif
 endif
 endif