3 # (C) 2004-2009 by the OpenBIOS team
12 HOSTCFLAGS+= -O2 -g -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
13 HOSTCFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
14 HOSTCFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
15 HOSTCFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
17 # Flags for dependency generation
18 HOSTCFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d'
19 HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
26 STRIP := $(TARGET)strip
27 RANLIB := $(TARGET)ranlib
29 CFLAGS+= -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS
30 CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
31 CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
32 CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
34 # Flags for dependency generation
35 CFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d'
36 INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
39 quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
45 all: versions dictionaries host-libraries target-libraries host-executables target-executables
47 versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
49 $(ODIR)/forth/version.fs:
50 $(call quiet-command,true, " GEN $(TARGET_DIR)$@")
51 @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
52 ( echo ": builddate \" $$DATE\" ; " ; \
53 echo ": version \" $(VERSION)\" ; " ; ) \
54 > $(dir $@)/version.fs
56 $(ODIR)/target/include/openbios-version.h:
57 $(call quiet-command,true, " GEN $(TARGET_DIR)$@")
58 @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
59 ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
60 echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; ) \
61 > $(dir $@)/openbios-version.h
64 @echo "Building OpenBIOS on $(HOSTARCH) for $(ARCH)"
67 @printf "Cleaning up for $(ARCH)..."
68 @rm -rf forth.dict.core forthstrap *.dict openbios-*
69 @rm -f $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
70 @find . -type f \( -name "*~" -o -name '*.o' -o -name '*.d' -o -name '*.a' \) -exec rm \{\} \;
73 build-verbose: info build
79 # Include automatically generated dependency files
80 -include $(wildcard $(ODIR)/host/kernel/*.d $(ODIR)/target/*/*.d $(ODIR)/target/*/*/*.d $(ODIR)/target/*/*/*/*.d)