]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/blob - lib/Makefile
Use CMake for compilation
[processor-sdk/open-amp.git] / lib / Makefile
1 # Make file to create ipc stack library.
3 # Include commons make file to get platform and tool chain specific variables.
4 BUILD := $(BUILDROOT)/lib
5 BUILDLIB := $(BUILDROOT)/libs
6 SRCROOT := $(CURDIR)
8 ifeq ($(MACHINE),)
9 export MACHINE := zynq7
10 endif
12 ifeq ($(SYSTEM),)
13 export SYSTEM := generic
14 endif
16 ifeq ($(OHOME),)
17 export OHOME := $(CURDIR)
18 endif
20 INCLUDES :=
22 -include system/$(SYSTEM)/machine/$(MACHINE)/Makefile.platform
23 -include system/$(SYSTEM)/Makefile.include
25 ifeq ($(BENCHMARK),1)
26 CFLAGS+=-D"OPENAMP_BENCHMARK_ENABLE"
27 endif
29 ifeq ($(LINUXREMOTE),1)
30 CFLAGS+=-D"OPENAMP_REMOTE_LINUX_ENABLE"
31 endif
33 LIB := $(BUILDLIB)/libopen_amp.a
35 INCLUDES += -I"include"
36 ifneq ("$(wildcard include/openamp/system/$(SYSTEM))","")
37 INCLUDES += -I"include/openamp/system/$(SYSTEM)"
38 endif
39 ifneq ("$(wildcard include/openamp/machine/$(MACHINE))","")
40 INCLUDES += -I"include/openamp/machine/$(MACHINE)"
41 endif
42 ifneq ("$(wildcard include/openamp/system/$(SYSTEM)/machine/$(MACHINE))","")
43 INCLUDES += -I"include/openamp/system/$(SYSTEM)/machine/$(MACHINE)"
44 endif
45 CFLAGS += $(INCLUDES)
47 C_SRCFILES += \
48 $(wildcard remoteproc/*.c) \
49 $(wildcard virtio/*.c) \
50 $(wildcard rpmsg/*.c) \
51 $(wildcard common/*.c) \
52 $(wildcard proxy/*.c) \
53 $(wildcard system/$(SYSTEM)/*.c) \
54 $(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.c) \
55 $(wildcard machine/$(MACHINE)/*.c)
57 AS_SRCFILES =
59 ifeq ($(MACHINE),zynqmp_r5)
60 C_SRCFILES += remoteproc/drivers/zynqmp_remoteproc_a53.c
61 endif
63 ifeq ($(MACHINE),zynq7)
64 C_SRCFILES += remoteproc/drivers/zynq_remoteproc_a9.c
65 AS_SRCFILES += remoteproc/drivers/zynq_a9_trampoline.S
66 endif
68 OBJFILES := $(patsubst %.c, $(BUILD)/%.o, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.o, $(AS_SRCFILES))
70 DEPFILES := $(patsubst %.c, $(BUILD)/%.d, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.d, $(AS_SRCFILES))
72 all: $(LIB)
74 $(LIB): $(BUILDLIB) $(OBJFILES)
75         @echo AR $@
76         $(AR) -r $@ $(OBJFILES)
78 $(BUILD)/%.o:%.c
79         @mkdir -p $(dir $@)
80         @echo CC $(<:.c=.o)
81         $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c $< -o $@
83 $(BUILD)/%.o:%.S
84         @echo AS $(<:.S=.o)
85         $(AS) $(ARCH_ASFLAGS) $< -o $@
87 $(BUILD) $(BUILDLIB):
88         mkdir -p $@
90 clean:
91         rm -rf $(BUILD)
93 PHONY: all clean