Added Linux example and updated release notes
[keystone-rtos/rm-lld.git] / build / armv7 / librm_aearmv7.mk
1 #*******************************************************************************
2 #* FILE PURPOSE: Lower level makefile for Creating Component Libraries for ARMv7
3 #*******************************************************************************
4 #* FILE NAME: ./lib/librm_aearmv7.mk
5 #*
6 #* DESCRIPTION: Defines Source Files, Compilers flags and build rules
7 #*
8 #*******************************************************************************
9 #
11 #
12 # Macro definitions referenced below
13 #
14 empty =
15 space =$(empty) $(empty)
17 # Output for prebuilt generated libraries
18 ARMV7LIBDIR ?= ./lib
19 ARMV7OBJDIR ?= ./obj
20 ARMV7OBJDIR := $(ARMV7OBJDIR)/rm/lib
21 ARMV7BINDIR ?= ./bin
23 ifdef CROSS_TOOL_INSTALL_PATH
24 # Support backwards compatibility with KeyStone1 approach
25  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
26  AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
27  AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
28  LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
29 endif
31 INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
33 INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD $(CFLAGS) $(LDFLAGS)
35 OBJEXT = o 
36 INTERNALLINKDEFS =
37 SRCDIR = ./src
38 UTLSRCDIR = ./util/libfdt
40 VPATH=$(SRCDIR):$(UTLSRCDIR)
42 #List the COMMONSRC Files
43 COMMONSRCC =        \
44     rm.c            \
45     rm_nameserver.c \
46     rm_policy.c     \
47     rm_services.c   \
48     rm_transport.c  \
49     rm_tree.c       \
50     rm_dtb_util.c   \
51     rm_allocator.c  \
52     fdt.c           \
53     fdt_ro.c        \
54     fdt_rw.c        \
55     fdt_strerror.c  \
56     fdt_sw.c        \
57     fdt_wip.c
59 # FLAGS for the COMMONSRC Files
60 COMMONSRCCFLAGS = $(DEBUG_FLAG) -I$(SRCDIR) -I$(UTLSRCDIR) -I.
62 # Make Rule for the COMMONSRC Files
63 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(COMMONSRCC))
65 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
66         -@echo compiling $< ...
67         @$(CC) -c $(COMMONSRCCFLAGS) $(INTERNALDEFS) $(INCS)  $< -o $@
69 $(ARMV7LIBDIR)/librm.a: $(COMMONSRCCOBJS) $(ARMV7LIBDIR)/.created
70         @echo archiving $? into $@ ...
71         @$(AR) -r $@ $?
73 $(ARMV7OBJDIR)/.created:
74         @mkdir -p $(ARMV7OBJDIR)
75         @touch $(ARMV7OBJDIR)/.created
77 $(ARMV7LIBDIR)/.created:
78         @mkdir -p $(ARMV7LIBDIR)
79         @touch $(ARMV7LIBDIR)/.created
81 clean:
82         @$(RMDIR) $(ARMV7OBJDIR)