mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-12 00:47:46 -04:00
dtc: Refactor Makefiles
This patch makes a number of Makefile cleanups and improvements: - We use more generic rules to invoke flex and bison, which is useful for some of the other changes. - We use the name dtc-lexer.lex.c for the flex output, instead of the default lex.yy.c. That means less potential for confusion if dtc is embedded into other projects (e.g. the kernel). - We separate out a Makefile.dtc designed for embedding into other projects, analagous to Makefile.libfdt. - Makefile.libfdt is cleaned up to be more useful based on some actual trial runs of embedding libfdt in the kernel bootwrapper. - Versioning related rules and variables are collected into one place in the Makefile. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d2a9da0458
commit
ad9593f229
3 changed files with 139 additions and 106 deletions
|
|
@ -3,19 +3,12 @@
|
|||
# This is not a complete Makefile of itself. Instead, it is designed to
|
||||
# be easily embeddable into other systems of Makefiles.
|
||||
#
|
||||
LIBFDT_OBJS_L = fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o fdt_strerror.o
|
||||
LIBFDT_OBJS = $(LIBFDT_OBJS_L:%=$(LIBFDT_PREFIX)%)
|
||||
LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
|
||||
LIBFDT_INCLUDES = fdt.h libfdt.h
|
||||
LIBFDT_EXTRA = libfdt_internal.h
|
||||
LIBFDT_LIB = libfdt/libfdt.a
|
||||
|
||||
LIBFDT_LIB_L = libfdt.a
|
||||
LIBFDT_LIB = $(LIBFDT_LIB_L:%=$(LIBFDT_PREFIX)%)
|
||||
LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
|
||||
|
||||
LIBFDT_INCLUDES_L = fdt.h libfdt.h
|
||||
LIBFDT_INCLUDES = $(LIBFDT_INCLUDES_L:%=$(LIBFDT_PREFIX)%)
|
||||
$(LIBFDT_objdir)/$(LIBFDT_LIB): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
|
||||
|
||||
LIBFDT_CLEANFILES_L = *~ *.o *.d *.a $(LIBFDT_LIB) \
|
||||
*.i *.s a.out core
|
||||
LIBFDT_CLEANFILES = $(LIBFDT_CLEANFILES_L:%=$(LIBFDT_PREFIX)%)
|
||||
|
||||
$(LIBFDT_LIB): $(LIBFDT_OBJS)
|
||||
|
||||
LIBFDT_DEPFILES = $(LIBFDT_OBJS:%.o=%.d)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue