summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f54e136)
raw | patch | inline | side by side (parent: f54e136)
author | Wendy Liang <jliang@xilinx.com> | |
Fri, 8 Jan 2016 21:49:51 +0000 (13:49 -0800) | ||
committer | Wendy Liang <jliang@xilinx.com> | |
Tue, 9 Feb 2016 19:54:54 +0000 (11:54 -0800) |
It is not necessary to have other directories between
echo_test/ and apps/, move it under apps/
Signed-off-by: Wendy Liang <jliang@xilinx.com>
echo_test/ and apps/, move it under apps/
Signed-off-by: Wendy Liang <jliang@xilinx.com>
apps/echo_test/Makefile | [new file with mode: 0644] | patch | blob |
apps/echo_test/echo_testd.c | [moved from apps/tests/remote/generic/echo_test/echo_test.c with 100% similarity] | patch | blob | history |
apps/echo_test/echo_testd_remoteproc_master.c | [moved from apps/tests/master/generic/echo_test/echo_test.c with 100% similarity] | patch | blob | history |
apps/tests/master/generic/echo_test/make | [deleted file] | patch | blob | history |
apps/tests/remote/generic/echo_test/make | [deleted file] | patch | blob | history |
diff --git a/apps/echo_test/Makefile b/apps/echo_test/Makefile
--- /dev/null
+++ b/apps/echo_test/Makefile
@@ -0,0 +1,46 @@
+
+include $(SRCROOT)/Makefile.common
+
+PBUILD := $(BUILD)
+BUILD := $(PBUILD)/$(shell basename $(CURDIR))
+
+EXES := $(BUILD)/echo_testd.out
+
+ifeq ($(REMOTEPROC_MASTER),y)
+ECHO_TEST_D_SRCS := echo_testd_remoteproc_master.c
+else
+ECHO_TEST_D_SRCS := echo_testd.c
+endif
+
+ECHO_TEST_D_OBJS := $(patsubst %.c,$(BUILD)/%.o,$(ECHO_TEST_D_SRCS))
+
+C_COMMON_OBJS := $(foreach f,$(C_COMMON_SRCS),$(BUILD)/$(patsubst %c,%o,$(shell basename $(f))))
+
+# Create obj files dependencies
+$(foreach f,$(ECHO_TEST_D_SRCS) $(C_COMMON_SRCS),$(eval $(patsubst %.c,%.o,$(BUILD)/$(shell basename $(f)))_dep := $(f)))
+
+ECHO_TEST_D_MAP := $(patsubst %.out,%.map, $(EXES))
+
+LIBS := -lopen_amp $(DEPS)
+
+.PHONY: all clean
+
+all: $(EXES)
+
+$(BUILD)/echo_testd.out: $(ECHO_TEST_D_OBJS) $(C_COMMON_OBJS)
+
+ @echo 'Building echo test for baremetal : $@'
+
+ $(LD) -Wl,-Map=$(ECHO_TEST_D_MAP) -Wl,--gc-sections -T"$(LINKERSCRIPT)" $(LDFLAGS) -o "$@" $^ -Wl,--start-group $(LIBS) -Wl,--end-group
+
+clean:
+ rm -rf $(BUILD)
+
+.SECONDEXPANSION:
+%.o: $$($$@_dep)
+ mkdir -p $(dir $@);
+ $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
+
+# This is to avoid the warning of non-existing Makefile
+%/Makefile.include:
+
similarity index 100%
rename from apps/tests/remote/generic/echo_test/echo_test.c
rename to apps/echo_test/echo_testd.c
rename from apps/tests/remote/generic/echo_test/echo_test.c
rename to apps/echo_test/echo_testd.c
diff --git a/apps/tests/master/generic/echo_test/echo_test.c b/apps/echo_test/echo_testd_remoteproc_master.c
similarity index 100%
rename from apps/tests/master/generic/echo_test/echo_test.c
rename to apps/echo_test/echo_testd_remoteproc_master.c
rename from apps/tests/master/generic/echo_test/echo_test.c
rename to apps/echo_test/echo_testd_remoteproc_master.c
diff --git a/apps/tests/master/generic/echo_test/make b/apps/tests/master/generic/echo_test/make
+++ /dev/null
@@ -1,51 +0,0 @@
-
-include ../Makefile.commons
-
-SAMPLE_OUT := tests/master/baremetal/echo_test/echo_test.out
-SAMPLE_SRC := tests/master/baremetal/echo_test/echo_test.c
-
-
-REMOTE_OUT := echo_test.out
-LINUX_SRC_DIR := firmware/$(MACHINE)/linux
-DST_DIR := tests/master/baremetal/echo_test
-
-SAMPLEOBJFILES := $(patsubst %.c, %.o, $(SAMPLE_SRC))
-
-SAMPLE_DEPS := $(patsubst %.c, %.d, $(SAMPLE_SRC))
-
-SAMPLE_MAP := $(patsubst %.out, %.map, $(SAMPLE_OUT))
-SAMPLE_BIN := $(patsubst %.out, %.bin, $(SAMPLE_OUT))
-
-$(SAMPLE_OUT): $(REMOTE_OUT) $(SAMPLEOBJFILES)
-
- @echo 'Building echo test for baremetal : $@'
-
- $(LD) -Wl,-Map=tests/master/baremetal/echo_test/echo_test.map -Wl,--gc-sections -T"$(OHOME)/libs/system/$(MACHINE)/baremetal/linker_master.ld" -L"$(OHOME)/libs/open_amp" -L"$(OHOME)/libs/system/$(MACHINE)/baremetal" -o "$(SAMPLE_OUT)" -Wl,--start-group $(SAMPLEOBJFILES) $(DST_DIR)/firmware1.o $(DST_DIR)/firmware2.o -lopen_amp -lbaremetal_master -lc -lm -lstdc++ -lcs3 -lcs3arm -lcs3unhosted -Wl,--end-group
-
- $(OBJCPY) -O binary $(SAMPLE_OUT) $(SAMPLE_BIN)
-
- @echo 'Finished building target: $@'
-
-%.o:%.c
- @echo CC $(<:.c=.o)
- @$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
-
-$(REMOTE_OUT):
- cd $(LINUX_SRC_DIR)/; cp firmware firmware1; \
- $(OBJCPY) -I binary -O elf32-littlearm -B arm firmware1 firmware1.o
- mv $(LINUX_SRC_DIR)/firmware1.o $(DST_DIR)/firmware1.o
- cd $(LINUX_SRC_DIR)/; cp firmware firmware2; \
- $(OBJCPY) -I binary -O elf32-littlearm -B arm firmware2 firmware2.o
- mv $(LINUX_SRC_DIR)/firmware2.o $(DST_DIR)/
- cd $(LINUX_SRC_DIR)/; rm firmware1; rm firmware2;
-
-clean:
- -$(RM) $(SAMPLEOBJFILES) $(SAMPLE_DEPS) $(SAMPLE_OUT) $(SAMPLE_MAP) $(SAMPLE_BIN) $(DST_DIR)/firmware1.o $(DST_DIR)/firmware2.o
-
-post-build:
- -@echo ' '
-
-secondary-outputs:
-
-PHONY: all clean dependents
-.SECONDARY: post-build
diff --git a/apps/tests/remote/generic/echo_test/make b/apps/tests/remote/generic/echo_test/make
+++ /dev/null
@@ -1,51 +0,0 @@
-
-include $(OPENAMP)/Makefile.commons
-
-SAMPLE_OUT := echo_test.out
-
-SAMPLE_SRC := echo_test.c rsc_table.c
-
-
-SAMPLEOBJFILES := $(patsubst %.c, %.o, $(SAMPLE_SRC))
-
-SAMPLE_DEPS := $(patsubst %.c, %.d, $(SAMPLE_SRC))
-
-SAMPLE_MAP := $(patsubst %.out, %.map, $(SAMPLE_OUT))
-
-LIBS := -lopen_amp -lbaremetal_remote -lc -lm
-
-ifeq ($(MACHINE),zynqMP_r5)
-CFLAGS += -DZYNQMP_R5
-LIBS += -lxil
-else
-ifeq ($(MACHINE),zc702evk)
-CFLAGS += -DZYNQ_A9
-LIBS += -lcs3 -lcs3arm -lcs3unhosted
-endif
-endif
-
-$(SAMPLE_OUT): $(SAMPLEOBJFILES)
-
- @echo 'Building echo test for baremetal : $@'
-
- $(LD) -Wl,-Map=echo_test.map -Wl,--gc-sections -T"$(OHOME)/libs/system/$(MACHINE)/baremetal/linker_remote.ld" -L"$(OHOME)/libs/open_amp" -L"$(OHOME)/libs/system/$(MACHINE)/baremetal" -o "$(SAMPLE_OUT)" -Wl,--start-group $(SAMPLEOBJFILES) $(LIBS) -Wl,--end-group
-
- mkdir -p $(OHOME)/apps/firmware/$(MACHINE)/$(SYSTEM)/echo_test
- $(CP) $(SAMPLE_OUT) $(OHOME)/apps/firmware/$(MACHINE)/$(SYSTEM)/echo_test/firmware
-
- @echo 'Finished building target: $@'
-
-%.o:%.c
- @echo CC $(<:.c=.o)
- @$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
-
-clean:
- -$(RM) $(SAMPLEOBJFILES) $(SAMPLE_DEPS) $(SAMPLE_OUT) $(SAMPLE_MAP)
-
-post-build:
- -@echo ' '
-
-secondary-outputs:
-
-PHONY: all clean dependents
-.SECONDARY: post-build