From 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 18 Dec 2008 16:05:18 -0500 Subject: Unify all common build system parts Rather than duplicating the same thing over and over in every Makefile, move it all to common.mk. Other things fixed here: - doing subdirs in parallel - fix src!=build compiling in subdirs Signed-off-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- Makefile | 79 +++++++++++++++++----------------------------------------------- 1 file changed, 21 insertions(+), 58 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8319599..969ab87 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,15 @@ # -*- sh -*- -PREFIX=/usr -EXEC_PREFIX=$(PREFIX) -SBINDIR=$(EXEC_PREFIX)/sbin -MANDIR=$(PREFIX)/share/man -INCLUDEDIR=$(PREFIX)/include - -#CROSS=arm-linux- -CC := $(CROSS)gcc -CFLAGS ?= -O2 -g -CFLAGS += -Wall CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) -ifeq ($(origin CROSS),undefined) - BUILDDIR := . -else -# Remove the trailing slash to make the directory name - BUILDDIR := $(CROSS:-=) -endif - ifeq ($(WITHOUT_XATTR), 1) CPPFLAGS += -DWITHOUT_XATTR endif -RAWTARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ +SUBDIRS = mkfs.ubifs ubi-utils + +TARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info \ flash_otp_info flash_otp_dump mtd_debug flashcp nandwrite nandtest \ jffs2dump \ @@ -33,71 +18,49 @@ RAWTARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ serve_image recv_image \ sumtool #jffs2reader -TARGETS = $(foreach target,$(RAWTARGETS),$(BUILDDIR)/$(target)) - SYMLINKS = -%: %.o - $(CC) $(CFLAGS) $(LDFLAGS) -g -o $@ $^ - -$(BUILDDIR)/%.o: %.c - mkdir -p $(BUILDDIR) - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -g -Wp,-MD,$(BUILDDIR)/.$( ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz - $(MAKE) -C $(BUILDDIR)/ubi-utils install - $(MAKE) -C $(BUILDDIR)/mkfs.ubifs install -- cgit v1.2.3