Added ARM makefile
authorJustin Sobota <jsobota@ti.com>
Tue, 23 Apr 2013 22:16:53 +0000 (18:16 -0400)
committerJustin Sobota <jsobota@ti.com>
Tue, 23 Apr 2013 22:16:53 +0000 (18:16 -0400)
build/armv7/librm_aearmv7.mk [new file with mode: 0644]
makefile_armv7 [new file with mode: 0644]

diff --git a/build/armv7/librm_aearmv7.mk b/build/armv7/librm_aearmv7.mk
new file mode 100644 (file)
index 0000000..ec58792
--- /dev/null
@@ -0,0 +1,83 @@
+#*******************************************************************************
+#* FILE PURPOSE: Lower level makefile for Creating Component Libraries for ARMv7
+#*******************************************************************************
+#* FILE NAME: ./lib/librm_aearmv7.mk
+#*
+#* DESCRIPTION: Defines Source Files, Compilers flags and build rules
+#*
+#*******************************************************************************
+#
+
+#
+# Macro definitions referenced below
+#
+empty =
+space =$(empty) $(empty)
+
+# Output for prebuilt generated libraries
+ARMV7LIBDIR ?= ./lib
+ARMV7OBJDIR ?= ./obj
+ARMV7OBJDIR := $(ARMV7OBJDIR)/rm/lib
+ARMV7BINDIR ?= ./bin
+
+ifdef CROSS_TOOL_INSTALL_PATH
+# Support backwards compatibility with KeyStone1 approach
+ CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+ AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
+ AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
+ LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+endif
+
+INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
+
+INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD $(CFLAGS) $(LDFLAGS)
+
+OBJEXT = o 
+INTERNALLINKDEFS =
+SRCDIR = ./src
+UTLSRCDIR = ./util/libfdt
+
+VPATH=$(SRCDIR) $(UTLSRCDIR)
+
+#List the COMMONSRC Files
+COMMONSRCC =        \
+    rm.c            \
+    rm_nameserver.c \
+    rm_policy.c     \
+    rm_services.c   \
+    rm_transport.c  \
+    rm_tree.c       \
+    rm_dtb_util.c   \
+    rm_allocator.c  \
+    fdt.c           \
+    fdt_ro.c        \
+    fdt_rw.c        \
+    fdt_strerror.c  \
+    fdt_sw.c        \
+    fdt_wip.c
+
+# FLAGS for the COMMONSRC Files
+COMMONSRCCFLAGS = $(DEBUG_FLAG) -I$(SRCDIR) -I$(UTLSRCDIR) -I.
+
+# Make Rule for the COMMONSRC Files
+COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(COMMONSRCC))
+
+$(COMMONSRCCOBJS): $(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
+       -@echo compiling $< ...
+       @$(CC) -c $(COMMONSRCCFLAGS) $(INTERNALDEFS) $(INCS)  $< -o $@
+
+$(ARMV7LIBDIR)/librm.a: $(COMMONSRCCOBJS) $(ARMV7LIBDIR)/.created
+       @echo archiving $? into $@ ...
+       @$(AR) -r $@ $?
+
+$(ARMV7OBJDIR)/.created:
+       @mkdir -p $(ARMV7OBJDIR)
+       @touch $(ARMV7OBJDIR)/.created
+
+$(ARMV7LIBDIR)/.created:
+       @mkdir -p $(ARMV7LIBDIR)
+       @touch $(ARMV7LIBDIR)/.created
+
+clean:
+       @$(RMDIR) $(ARMV7OBJDIR)
+
diff --git a/makefile_armv7 b/makefile_armv7
new file mode 100644 (file)
index 0000000..b6730fd
--- /dev/null
@@ -0,0 +1,112 @@
+#*******************************************************************************
+#* FILE PURPOSE: Top level makefile for Creating Component Libraries for ARM
+#* architectures
+#*******************************************************************************
+#* FILE NAME: makefile
+#*
+#* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options 
+#*
+#*
+#*******************************************************************************
+#*
+# (Mandatory) Specify where various tools are installed.
+
+# Output for prebuilt generated libraries
+export ARMV7LIBDIR ?= ./lib
+export DEVICE ?=k2h
+export ARMV7OBJDIR ?= ./obj/$(DEVICE)
+export ARMV7BINDIR ?= ./bin/$(DEVICE)
+
+# ROOT Directory
+export ROOTDIR := ../../..
+
+# INSTALL default paths
+export INSTALL_BIN_BASE_DIR ?= ./install/bin
+export INSTALL_INC_BASE_DIR ?= ./install/include
+export INSTALL_LIB_BASE_DIR ?= ./install/lib
+
+# INCLUDE Directory
+export INCDIR := ../../..;$(PDK_INSTALL_PATH);$(ROOTDIR)
+
+# Common Macros used in make
+
+ifndef RM
+export RM = rm -f
+endif
+
+ifndef CP
+export CP = cp -p
+endif
+
+export MKDIR = mkdir -p
+
+ifndef RMDIR
+export RMDIR = rm -rf
+endif
+
+ifndef SED
+export SED = sed
+endif
+
+ifndef MAKE
+export MAKE = make
+endif
+
+# PHONY Targets
+#.PHONY: all clean lib tests install installbin
+.PHONY: all clean lib install installbin
+
+# all rule
+all: .executables install installbin
+#.executables: lib tests
+.executables: lib
+
+# Libraries
+lib: .libraries
+
+# tests Stub to add tests
+#tests: 
+#      @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile all
+
+# examples Stub to add Examples
+#examples: 
+#      @$(MAKE) -f ./example/InfraDmaSC/$(DEVICE)/armv7/linux/build/makefile all
+
+# Make rule to create $(ARMV7LIBDIR)/librm.a library
+.libraries: $(ARMV7LIBDIR)/librm.a
+
+$(ARMV7LIBDIR)/librm.a:
+       @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
+
+# Rule to clean $(ARMV7LIBDIR)/librm.a library
+clean:
+       @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
+#      @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile $@
+       @$(RMDIR) $(ARMV7OBJDIR)/rm
+       @$(RMDIR) $(ARMV7BINDIR)/rm
+       @$(RM) $(ARMV7LIBDIR)/librm.a
+
+installbin:
+       install -d $(INSTALL_BIN_BASE_DIR)
+#      install -c -m 755 $(ARMV7BINDIR)/rm/test/rmTest.out    $(INSTALL_BIN_BASE_DIR)/rmTest_$(DEVICE).out
+#      install -c -m 755 $(ARMV7BINDIR)/rm/test/rmMemTest.out    $(INSTALL_BIN_BASE_DIR)/rmMemTest_$(DEVICE).out       
+#      install -c -m 755 $(ARMV7BINDIR)/rm/test/rmSharedTest.out    $(INSTALL_BIN_BASE_DIR)/rmSharedTest_$(DEVICE).out
+
+install:
+       install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/include
+       install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
+       install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt
+       install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k/
+       install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h/        
+       install -d $(INSTALL_LIB_BASE_DIR)
+       $(CP) ./*.h                $(INSTALL_INC_BASE_DIR)/ti/drv/rm
+       $(CP) ./include/*.h        $(INSTALL_INC_BASE_DIR)/ti/drv/rm/include
+       $(CP) ./util/*.h        $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
+       $(CP) ./util/libfdt/*.h $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt   
+       $(CP) ./device/k2h/*.c $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
+       $(CP) ./device/k2h/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
+       $(CP) ./device/k2h/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h           
+       $(CP) ./device/k2k/*.c $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k     
+       $(CP) ./device/k2k/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k   
+       $(CP) ./device/k2k/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k           
+       @$(CP) -r $(ARMV7LIBDIR)/*.a         $(INSTALL_LIB_BASE_DIR)
\ No newline at end of file