]> git.buserror.net Git - polintos/scott/priv.git/blob - Makefile.target
Remove C language stub.
[polintos/scott/priv.git] / Makefile.target
1 ifndef TARGETDEFS
2 TARGETDEFS := done
3
4 ifndef ARCH
5 $(error Please define $$(ARCH).)
6 endif
7
8 VALIDARCH := no
9
10 ifeq ($(ARCH),x86)
11 CROSS := i686-polintos-
12 DEFS += -DBITFIELD_LE
13 VALIDARCH := yes
14 endif
15
16 ifeq ($(ARCH),x64)
17 CROSS := x86_64-polintos-
18 DEFS += -DBITFIELD_LE
19 VALIDARCH := yes
20 endif
21
22 ifeq ($(VALIDARCH),no)
23 $(error $(ARCH) is not a supported target.)
24 endif
25
26 ifndef USECROSS
27 CROSS :=
28 endif
29
30 ifdef NOSMP
31 DEFS += -D_LL_NOSMP
32 endif
33
34 # C++ prohibits defeferencing a NULL non-POD pointer (and thus
35 # prohibits using offsetof on non-POD types, even though there's no
36 # good reason to disallow it).  Some headers use offsetof on non-POD
37 # types (typically, the types are non-POD only because they have a
38 # constructor to initialize fields to a known state (or with
39 # passed-in values); hardly a reason to make it completely non-POD
40 # and throw out a bazillion otherwise legal actions).
41 #
42 # Thus, since I know of no way (such as a #pragma) for code to
43 # disable a warning itself for a specific region of code, everything
44 # needs to disable this warning.  On one hand, I consider it a bogus
45 # warning, and thus it's not that big of a deal.  On the other hand,
46 # having the warning suppressed means you won't know if your code
47 # will produce the warning in other environments without actually
48 # trying it there.  Oh well; blame the C++ and/or GCC people, not me.
49 #
50 # This warning option requires at least GCC 3.4.  If you want to use
51 # an older compiler, remove this and live with the warnings (as well
52 # as whatever other unknown issues you encounter).
53
54 CXXWARN += $(WARN) -Wno-invalid-offsetof
55
56 ifndef BUILDTYPE
57 BUILDTYPE := user
58 endif
59
60 BUILDNAME := build
61 BASEBUILDDIR := $(TOP)/$(BUILDNAME)
62 ARCHBUILDDIR := $(TOP)/$(BUILDNAME)/$(ARCH)
63
64 ifeq ($(ARCHINDEP),y)
65 BUILDDIR := $(BASEBUILDDIR)/$(BUILDTYPE)/$(COMP)
66 else
67 BUILDDIR := $(ARCHBUILDDIR)/$(BUILDTYPE)/$(COMP)
68 endif
69
70 UTILBUILDDIR := $(BASEBUILDDIR)/build/utils
71 SERVERDIR := $(BUILDDIR)/include/servers
72
73 IFACES := $(BASEBUILDDIR)/build/idl/ifaces
74 GENINCLUDES := $(ARCHBUILDDIR)/build/include/generated
75
76 BUILDCC := g++
77 BUILDCXX := g++
78 CC := $(CROSS)g++
79 CXX := $(CROSS)g++
80 AS := $(CROSS)as
81 LD := $(CROSS)ld
82 STRIP := $(CROSS)strip
83 DEFS += -D_LL_ARCH_$(ARCH) -D_LL_ARCH=$(ARCH)
84 MKDIR := mkdir -p
85 MV := mv
86 RM := rm -f
87 RMDIR := rm -rf
88 LN := ln -s
89 IDLC := $(BASEBUILDDIR)/build/idlcomp/idlc
90 TOUCH := touch
91 BISON := bison
92 FLEX := flex
93
94 # If you want to cross-compile idlc, set BUILD_ENDIAN to LE or BE
95 # and build only the idlc component.  Also, set BUILDCXX to the
96 # cross compiler.
97
98 ifndef BUILD_ENDIAN
99 $(shell $(MKDIR) $(UTILBUILDDIR))
100 $(shell $(BUILDCC) $(TOP)/utils/buildendian.c -o $(UTILBUILDDIR)/buildendian)
101 BUILD_ENDIAN := $(shell $(UTILBUILDDIR)/buildendian)
102 endif
103
104 ifndef BUILD_BFENDIAN
105 $(shell $(MKDIR) $(UTILBUILDDIR))
106 $(shell $(BUILDCC) $(TOP)/utils/buildbfendian.c -o $(UTILBUILDDIR)/buildbfendian)
107 BUILD_BFENDIAN := $(shell $(UTILBUILDDIR)/buildendian)
108 endif
109
110 BUILDDEFS += -DBITFIELD_$(BUILD_BFENDIAN)
111
112 endif