Use lib/ for source files for OpenAMP library
authorWendy Liang <jliang@xilinx.com>
Fri, 8 Jan 2016 04:10:12 +0000 (20:10 -0800)
committerWendy Liang <jliang@xilinx.com>
Tue, 9 Feb 2016 19:54:47 +0000 (11:54 -0800)
Move OpenAMP source files into lib/ directory.

Porting/ is not necessary, move porting/system/ to system/

Signed-off-by: Wendy Liang <jliang@xilinx.com>
47 files changed:
Makefile
Makefile.commons [deleted file]
lib/Makefile [new file with mode: 0644]
lib/common/firmware.c [moved from common/firmware.c with 100% similarity]
lib/common/hil.c [moved from common/hil.c with 100% similarity]
lib/common/llist.c [moved from common/llist.c with 100% similarity]
lib/common/sh_mem.c [moved from common/sh_mem.c with 100% similarity]
lib/include/openamp/compiler.h [moved from include/openamp/compiler.h with 100% similarity]
lib/include/openamp/elf_loader.h [moved from include/openamp/elf_loader.h with 100% similarity]
lib/include/openamp/env.h [moved from include/openamp/env.h with 100% similarity]
lib/include/openamp/firmware.h [moved from include/openamp/firmware.h with 100% similarity]
lib/include/openamp/hil.h [moved from include/openamp/hil.h with 100% similarity]
lib/include/openamp/llist.h [moved from include/openamp/llist.h with 100% similarity]
lib/include/openamp/open_amp.h [moved from include/openamp/open_amp.h with 100% similarity]
lib/include/openamp/remoteproc.h [moved from include/openamp/remoteproc.h with 100% similarity]
lib/include/openamp/remoteproc_loader.h [moved from include/openamp/remoteproc_loader.h with 100% similarity]
lib/include/openamp/rpmsg.h [moved from include/openamp/rpmsg.h with 100% similarity]
lib/include/openamp/rpmsg_core.h [moved from include/openamp/rpmsg_core.h with 100% similarity]
lib/include/openamp/rpmsg_retarget.h [moved from include/openamp/rpmsg_retarget.h with 100% similarity]
lib/include/openamp/rsc_table_parser.h [moved from include/openamp/rsc_table_parser.h with 100% similarity]
lib/include/openamp/sh_mem.h [moved from include/openamp/sh_mem.h with 100% similarity]
lib/include/openamp/system/generic/machine/zynq7/machine.h [moved from include/openamp/system/generic/machine/zynq7/machine.h with 100% similarity]
lib/include/openamp/system/generic/machine/zynqmp_r5/machine.h [moved from include/openamp/system/generic/machine/zynqmp_r5/machine.h with 100% similarity]
lib/include/openamp/virtio.h [moved from include/openamp/virtio.h with 100% similarity]
lib/include/openamp/virtio_ring.h [moved from include/openamp/virtio_ring.h with 100% similarity]
lib/include/openamp/virtqueue.h [moved from include/openamp/virtqueue.h with 100% similarity]
lib/proxy/master/linux/kernelspace/rpmsg_proxy_dev_driver.c [moved from proxy/master/linux/kernelspace/rpmsg_proxy_dev_driver.c with 100% similarity]
lib/proxy/master/linux/userspace/proxy_app.c [moved from proxy/master/linux/userspace/proxy_app.c with 100% similarity]
lib/proxy/master/linux/userspace/proxy_app.h [moved from proxy/master/linux/userspace/proxy_app.h with 100% similarity]
lib/proxy/rpmsg_retarget.c [moved from proxy/rpmsg_retarget.c with 100% similarity]
lib/remoteproc/elf_loader.c [moved from remoteproc/elf_loader.c with 100% similarity]
lib/remoteproc/remoteproc.c [moved from remoteproc/remoteproc.c with 100% similarity]
lib/remoteproc/remoteproc_loader.c [moved from remoteproc/remoteproc_loader.c with 100% similarity]
lib/remoteproc/rsc_table_parser.c [moved from remoteproc/rsc_table_parser.c with 100% similarity]
lib/rpmsg/remote_device.c [moved from rpmsg/remote_device.c with 100% similarity]
lib/rpmsg/rpmsg.c [moved from rpmsg/rpmsg.c with 100% similarity]
lib/rpmsg/rpmsg_core.c [moved from rpmsg/rpmsg_core.c with 100% similarity]
lib/system/generic/bm_env.c [moved from system/generic/bm_env.c with 100% similarity]
lib/system/generic/machine/zynq7/Makefile.platform [moved from system/generic/machine/zynq7/Makefile.platform with 100% similarity]
lib/system/generic/machine/zynq7/machine.c [moved from system/generic/machine/zynq7/machine.c with 100% similarity]
lib/system/generic/machine/zynq7/remoteproc_zynq7.c [moved from system/generic/machine/zynq7/remoteproc_zynq7.c with 100% similarity]
lib/system/generic/machine/zynq7/zynq_trampoline.S [moved from system/generic/machine/zynq7/zynq_trampoline.S with 100% similarity]
lib/system/generic/machine/zynqmp_r5/Makefile.platform [moved from system/generic/machine/zynqmp_r5/Makefile.platform with 86% similarity]
lib/system/generic/machine/zynqmp_r5/machine.c [moved from system/generic/machine/zynqmp_r5/machine.c with 100% similarity]
lib/system/generic/machine/zynqmp_r5/remoteproc_zynqmp.c [moved from system/generic/machine/zynqmp_r5/remoteproc_zynqmp.c with 100% similarity]
lib/virtio/virtio.c [moved from virtio/virtio.c with 100% similarity]
lib/virtio/virtqueue.c [moved from virtio/virtqueue.c with 100% similarity]

index 653fe7bda49d253c5e0c9c838145dea6fac36120..107d1a1a74c0b29bebecaf4181a433c327754115 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,46 +1,46 @@
-# Make file to create ipc stack library.
+ifeq ($(SYSTEM),)
+SYSTEM := generic
+endif
 
-# Include commons make file to get platform and tool chain specific variables.
-include Makefile.commons
+ifeq ($(MACHINE),)
+MACHINE := zynq7
+endif
 
-LIB := libs/open_amp/libopen_amp.a
+OHOME := $(CURDIR)
+ifeq ($(BUILDROOT),)
+BUILDROOT := $(CURDIR)/.build
+endif
 
-INCLUDES := -I"include" -I"include/openamp/system/$(SYSTEM)/machine/$(MACHINE)"
-INCLUDES += -I"libs/system/$(MACHINE)/$(SYSTEM)"
-CFLAGS += $(INCLUDES)
+export SYSTEM MACHINE ROLE OHOME BUILDROOT
 
-C_SRCFILES += \
-$(wildcard remoteproc/*.c) \
-$(wildcard virtio/*.c) \
-$(wildcard rpmsg/*.c) \
-$(wildcard common/*.c) \
-$(wildcard proxy/*.c) \
-$(wildcard system/$(SYSTEM)/*.c) \
-$(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.c) \
-$(wildcard machine/$(MACHINE)/*.c)
+.PHONY: all lib obsolete apps clean clean_lib clean_obsolete clean_apps
 
-AS_SRCFILES += \
-$(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.S)
+all: lib
 
-OBJFILES := $(patsubst %.c, %.o, $(C_SRCFILES)) $(patsubst %.S, %.o, $(AS_SRCFILES))
+clean:
+       rm -rf $(BUILDROOT)
 
-DEPFILES := $(patsubst %.c, %.d, $(C_SRCFILES)) $(patsubst %.S, %.d, $(AS_SRCFILES))
+ifeq ($(WITH_OBSOLETE),y)
+all: obsolete
+endif
+ifeq ($(WITH_APPS),y)
+all: apps
+endif
 
-all: $(LIB)
+lib:
+       make -C lib all
 
-$(LIB): $(OBJFILES)
-       @echo AR $@
-       $(AR) -r $@ $(OBJFILES)
+obsolete:
+       make -C obsolete
 
-%.o:%.c $(HEADERS)
-       @echo CC $(<:.c=.o)
-       $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
+apps:
+       make -C apps all
 
-%.o:%.S
-       @echo AS $(<:.S=.o)
-       $(AS) $(ARCH_ASFLAGS) $(INCLUDE) $< -o $@
+clean_lib:
+       make -C lib clean
 
-clean:
-       -$(RM) $(LIB) $(OBJFILES) $(DEPFILES)
+clean_obsolete:
+       make -C obsolete clean
 
-PHONY: all clean
+clean_apps:
+       make -C apps clean
diff --git a/Makefile.commons b/Makefile.commons
deleted file mode 100644 (file)
index 36506bf..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-INCLUDE          := \r
-RM               := rm -f\r
-CP               := cp\r
-\r
-ifeq ($(MACHINE),)\r
-export MACHINE := zynq7\r
-endif\r
-
-ifeq ($(SYSTEM),)
-export SYSTEM := generic
-endif
-
-ifeq ($(OHOME),)
-export OHOME := $(CURDIR)
-endif
-
-include system/$(SYSTEM)/machine/$(MACHINE)/Makefile.platform
-
-ifeq ($(SYSTEM),baremetal)\r
-CFLAGS +=-D"ENV=1"\r
-CFLAGS +=-D"OPENAMP_BAREMETAL=1"
-\r
-ifeq ($(ROLE),master)\r
-CFLAGS+=-D"MASTER=1"\r
-else\r
-CFLAGS+=-D"MASTER=0"\r
-endif\r
-endif\r
-\r
-ifeq ($(BENCHMARK),1)\r
-CFLAGS+=-D"OPENAMP_BENCHMARK_ENABLE"\r
-endif\r
-\r
-ifeq ($(LINUXREMOTE),1)\r
-CFLAGS+=-D"OPENAMP_REMOTE_LINUX_ENABLE"\r
-endif\r
-\r
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644 (file)
index 0000000..17bac36
--- /dev/null
@@ -0,0 +1,92 @@
+# Make file to create ipc stack library.
+
+# Include commons make file to get platform and tool chain specific variables.
+BUILD := $(BUILDROOT)/lib
+BUILDLIB := $(BUILDROOT)/libs
+SRCROOT := $(CURDIR)
+
+ifeq ($(MACHINE),)
+export MACHINE := zynq7
+endif
+
+ifeq ($(SYSTEM),)
+export SYSTEM := generic
+endif
+
+ifeq ($(OHOME),)
+export OHOME := $(CURDIR)
+endif
+
+INCLUDES :=
+
+-include system/$(SYSTEM)/machine/$(MACHINE)/Makefile.platform
+-include system/$(SYSTEM)/Makefile.include
+
+ifeq ($(SYSTEM),generic)
+CFLAGS +=-D"OPENAMP_BAREMETAL=1"
+
+ifeq ($(ROLE),master)
+CFLAGS+=-D"MASTER=1"
+else
+CFLAGS+=-D"MASTER=0"
+endif
+endif
+
+ifeq ($(BENCHMARK),1)
+CFLAGS+=-D"OPENAMP_BENCHMARK_ENABLE"
+endif
+
+ifeq ($(LINUXREMOTE),1)
+CFLAGS+=-D"OPENAMP_REMOTE_LINUX_ENABLE"
+endif
+
+LIB := $(BUILDLIB)/libopen_amp.a
+
+INCLUDES += -I"include"
+ifneq ("$(wildcard include/openamp/system/$(SYSTEM))","")
+INCLUDES += -I"include/openamp/system/$(SYSTEM)"
+endif
+ifneq ("$(wildcard include/openamp/system/$(SYSTEM)/machine/$(MACHINE))","")
+INCLUDES += -I"include/openamp/system/$(SYSTEM)/machine/$(MACHINE)"
+endif
+CFLAGS += $(INCLUDES)
+
+C_SRCFILES += \
+$(wildcard remoteproc/*.c) \
+$(wildcard virtio/*.c) \
+$(wildcard rpmsg/*.c) \
+$(wildcard common/*.c) \
+$(wildcard proxy/*.c) \
+$(wildcard system/$(SYSTEM)/*.c) \
+$(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.c) \
+$(wildcard machine/$(MACHINE)/*.c)
+
+AS_SRCFILES += \
+$(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.S)
+
+OBJFILES := $(patsubst %.c, $(BUILD)/%.o, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.o, $(AS_SRCFILES))
+
+DEPFILES := $(patsubst %.c, $(BUILD)/%.d, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.d, $(AS_SRCFILES))
+
+all: $(LIB)
+
+$(LIB): $(BUILDLIB) $(OBJFILES)
+       @echo AR $@
+       $(AR) -r $@ $(OBJFILES)
+
+$(BUILD)/%.o:%.c
+       @mkdir -p $(dir $@)
+       @echo CC $(<:.c=.o)
+       $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c $< -o $@
+
+$(BUILD)/%.o:%.S
+       @echo AS $(<:.S=.o)
+       $(AS) $(ARCH_ASFLAGS) $< -o $@
+
+$(BUILD) $(BUILDLIB):
+       mkdir -p $@
+
+clean:
+       rm -rf $(BUILD)
+
+PHONY: all clean
similarity index 100%
rename from common/firmware.c
rename to lib/common/firmware.c
similarity index 100%
rename from common/hil.c
rename to lib/common/hil.c
similarity index 100%
rename from common/llist.c
rename to lib/common/llist.c
similarity index 100%
rename from common/sh_mem.c
rename to lib/common/sh_mem.c
similarity index 100%
rename from rpmsg/rpmsg.c
rename to lib/rpmsg/rpmsg.c
similarity index 100%
rename from rpmsg/rpmsg_core.c
rename to lib/rpmsg/rpmsg_core.c
similarity index 86%
rename from system/generic/machine/zynqmp_r5/Makefile.platform
rename to lib/system/generic/machine/zynqmp_r5/Makefile.platform
index d516f00e4f9e9d21d6e5a2c43fa11c821f09b749..04f3e81d402b77e90eb9535ccb7de79b9ee04d07 100644 (file)
@@ -14,4 +14,4 @@ AR               = $(CROSS)ar
 LD               = $(CROSS)gcc
 OBJCPY           = $(CROSS)objcopy
 
-INCLUDE += -I$(OHOME)/libs/system/$(MACHINE)/$(SYSTEM)/xil_standalone_lib
+INCLUDES += -I$(SRCROOT)/../obsolete/system/$(MACHINE)/$(SYSTEM)/xil_standalone_lib
similarity index 100%
rename from virtio/virtio.c
rename to lib/virtio/virtio.c
similarity index 100%
rename from virtio/virtqueue.c
rename to lib/virtio/virtqueue.c