switch-coreboot/util/dtc/Makefile
Stefan Reinauer 276a0e0ec9 * move post_code() to a seperate file
* statically link linuxbios.initram for now (depends on printk, post_code
  and die)
* greatly simplify all makefiles by creating a global Rules.make
* use $(dir $@) in Makefiles instead of absolute paths for mkdir..
* clean up Makefiles by calling components' code locally instead of in the
  Makefile. (Remember: one day, no code per mainboard)
* unconditionally create .xcompile in case it changed
* add NM to xcompile                          
* create $(obj)/linuxbios.map with all symbols of all stages

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@463 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-07-23 16:49:00 +00:00

62 lines
1.6 KiB
Makefile

TARGETS = dtc ftdump
CFLAGS = -Wall -g
BISON = bison
DTC_OBJS = dtc.o livetree.o flattree.o data.o treesource.o fstree.o \
dtc-parser.tab.o lex.yy.o
OBJS = $(DTC_OBJS) libdt.o ftdump.o
DEPFILES = $(DTC_OBJS:.o=.d)
#all: $(TARGETS)
$(obj)/util/dtc/dtc: $(patsubst %,$(obj)/util/dtc/%,$(DTC_OBJS))
$(Q)mkdir -p $(dir $@)
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(HOSTCC) -o $@ $^
ftdump: ftdump.o
$(Q)$(HOSTCC) -o $@ $^
$(obj)/util/dtc/dtc-parser.tab.c $(obj)/util/dtc/dtc-parser.tab.h: $(src)/util/dtc/dtc-parser.y
$(Q)mkdir -p $(dir $@)
$(Q)printf " BISON $(subst $(shell pwd)/,,$(@))\n"
$(Q)cd $(obj)/util/dtc; $(BISON) -d $< > $(obj)/util/dtc/dtc.bison.out 2>&1
$(obj)/util/dtc/lex.yy.c: $(src)/util/dtc/dtc-lexer.l
$(Q)cd $(obj)/util/dtc; $(LEX) $<
$(obj)/util/dtc/%.o: $(src)/util/dtc/%.c
$(Q)mkdir -p $(dir $@)
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(HOSTCC) -I$(src)/util/dtc $(HOSTCFLAGS) -o $@ -c $<
$(obj)/util/dtc/dtc-parser.tab.o: $(obj)/util/dtc/dtc-parser.tab.c
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(HOSTCC) -I$(src)/util/dtc $(HOSTCFLAGS) -o $@ -c $<
$(obj)/util/dtc/lex.yy.o: $(obj)/util/dtc/lex.yy.c $(obj)/util/dtc/dtc-parser.tab.h
$(Q)$(HOSTCC) -I$(src)/util/dtc $(HOSTCFLAGS) -o $@ -c $<
ifdef DTC_DEBUG
lex.yy.o: lex.yy.c dtc-parser.tab.h
check: all
$(Q)cd tests && $(MAKE) check
clean:
$(Q)rm -f *~ *.o a.out core $(TARGETS)
$(Q)rm -f *.tab.[ch] lex.yy.c
$(Q)rm -f *.i *.out vgcore.*
$(Q)rm -f *.d
$(Q)cd tests && $(MAKE) clean
endif
%.d: %.c
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(HOSTCC) -MM -MG -MT "$*.o $@" $< > $@
-include $(DEPFILES)