]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/blob - lib/Makefile
Move Linux userspace/kernelspace demo to obsolete
[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/system/$(SYSTEM)/machine/$(MACHINE))","")
40 INCLUDES += -I"include/openamp/system/$(SYSTEM)/machine/$(MACHINE)"
41 endif
42 CFLAGS += $(INCLUDES)
44 C_SRCFILES += \
45 $(wildcard remoteproc/*.c) \
46 $(wildcard virtio/*.c) \
47 $(wildcard rpmsg/*.c) \
48 $(wildcard common/*.c) \
49 $(wildcard proxy/*.c) \
50 $(wildcard system/$(SYSTEM)/*.c) \
51 $(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.c) \
52 $(wildcard machine/$(MACHINE)/*.c)
54 AS_SRCFILES += \
55 $(wildcard system/$(SYSTEM)/machine/$(MACHINE)/*.S)
57 OBJFILES := $(patsubst %.c, $(BUILD)/%.o, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.o, $(AS_SRCFILES))
59 DEPFILES := $(patsubst %.c, $(BUILD)/%.d, $(C_SRCFILES)) $(patsubst %.S, $(BUILD)/%.d, $(AS_SRCFILES))
61 all: $(LIB)
63 $(LIB): $(BUILDLIB) $(OBJFILES)
64         @echo AR $@
65         $(AR) -r $@ $(OBJFILES)
67 $(BUILD)/%.o:%.c
68         @mkdir -p $(dir $@)
69         @echo CC $(<:.c=.o)
70         $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c $< -o $@
72 $(BUILD)/%.o:%.S
73         @echo AS $(<:.S=.o)
74         $(AS) $(ARCH_ASFLAGS) $< -o $@
76 $(BUILD) $(BUILDLIB):
77         mkdir -p $@
79 clean:
80         rm -rf $(BUILD)
82 PHONY: all clean