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