]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/blobdiff - Makefile
Use CMake for compilation
[processor-sdk/open-amp.git] / Makefile
index 9d7d89427312fd02babb40254507b4ad25b0a339..2b74b218be1e461493416da959bdf80b70000894 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
 
-HEADERS += \
-$(wildcard include/*.h)
+export SYSTEM MACHINE OHOME BUILDROOT
 
-C_SRCFILES += \
-$(wildcard remoteproc/*.c) \
-$(wildcard virtio/*.c) \
-$(wildcard rpmsg/*.c) \
-$(wildcard common/hil/*.c) \
-$(wildcard common/llist/*.c) \
-$(wildcard common/shm/*.c) \
-$(wildcard common/firmware/*.c) \
-$(wildcard porting/env/*.c) \
-$(wildcard porting/$(PLAT)/*.c)
+.PHONY: all lib obsolete apps clean clean_lib clean_obsolete clean_apps
 
-AS_SRCFILES += \
-$(wildcard porting/$(PLAT)/*.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