File: Makefile.target

package info (click to toggle)
qemu 1%3A10.0.3%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 413,680 kB
  • sloc: ansic: 4,733,433; pascal: 114,769; python: 105,506; asm: 68,431; sh: 52,881; makefile: 27,469; perl: 18,778; cpp: 11,435; xml: 3,404; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (88 lines) | stat: -rw-r--r-- 3,143 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
#  OpenBIOS Makefile
# (C) 2004-2009 by the OpenBIOS team
#

include config.mak

ODIR := .
HOSTCC := gcc

HOSTCFLAGS+= -O2 -g -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
HOSTCFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
HOSTCFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
HOSTCFLAGS+= -Wbuiltin-declaration-mismatch -Wimplicit-fallthrough -Woverride-init -Wno-maybe-uninitialized
HOSTCFLAGS+= -W
# Flags for dependency generation
HOSTCFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d'
HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -iquote $(ODIR)/target/include

CC     := $(TARGET)gcc
AS     := $(TARGET)as
AR     := $(TARGET)ar
LD     := $(TARGET)ld
NM     := $(TARGET)nm
STRIP  := $(TARGET)strip
RANLIB := $(TARGET)ranlib

CFLAGS+= -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS
CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
CFLAGS+= -Wbuiltin-declaration-mismatch -Wimplicit-fallthrough -Woverride-init -Wno-maybe-uninitialized
CFLAGS+= -Werror
# Flags for dependency generation
CFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d'
INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS+= -g

# FCode tokeniser
TOKE   := toke

quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))

VPATH_SUFFIXES = %.c %.h %.S %.fs
set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
$(call set-vpath, $(SRCDIR))

#
# pre rules
#

all: versions dictionaries host-libraries target-libraries host-executables target-executables

versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs

$(ODIR)/forth/version.fs:
	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
	@DATE="$(shell echo `LC_ALL=C date --utc --date=@$(SOURCE_DATE_EPOCH) +'%b %e %Y %H:%M'`)" ;  \
		( echo ": builddate \" $$DATE\" ; " ;     \
		  echo ": version \" $(VERSION)\" ; " ; ) \
		  > $(dir $@)/version.fs

$(ODIR)/target/include/openbios-version.h:
	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
	@DATE="$(shell echo `LC_ALL=C date --utc --date=@$(SOURCE_DATE_EPOCH) +'%b %e %Y %H:%M'`)" ; \
          ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
           echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; ) \
         > $(dir $@)/openbios-version.h

info:
	@echo "Building OpenBIOS on $(HOSTARCH) for $(ARCH)"

clean:
	@printf "Cleaning up for $(ARCH)..."
	@rm -rf forth.dict.core forthstrap *.dict openbios-*
	@rm -f $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
	@find . -type f \( -name "*~" -o -name '*.o' -o -name '*.d' -o -name '*.a' \) -exec rm \{\} \;
	@echo " ok"

build-verbose: info build

build: all

include rules.mak

# Include automatically generated dependency files
-include $(wildcard $(ODIR)/*.d $(ODIR)/host/kernel/*.d $(ODIR)/target/*/*.d $(ODIR)/target/*/*/*.d $(ODIR)/target/*/*/*/*.d)