aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/buildsys/gnumake.inc
blob: 27052d682faeebbe1d10d6960a900f80364d67a0 (plain)
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
89
90
91
92
93
94
95
##############################################
# cross-compilation
##############################################

ifndef ARCH
ifeq ("$(shell uname -p)","powerpc")
ARCH := ppc
else
ARCH := $(shell uname -p)
endif
endif

##############################################
# some compiler definitions
##############################################

CFLAGS += $(UFLAGS)
$(foreach arch,$(ARCH),$(eval CFLAGS_$(arch) += $$(UFLAGS_$(arch)) ) )

ifdef DEBUG

DEFS += -D_DEBUG
CFLAGS += $(DFLAGS)

define ARCH_FLAGS
CFLAGS_$(1) += $$(DFLAGS_$(1))
endef

else  ## profile and release

DEFS += -DNDEBUG
CFLAGS += $(OFLAGS) 

define ARCH_FLAGS
CFLAGS_$(1) += $$(OFLAGS_$(1))
endef

endif

$(foreach arch,$(ARCH),$(eval $(call ARCH_FLAGS,$(arch))))


ifdef SHARED
# --- shared ---
DEFS += -DFLEXT_SHARED

else
ifdef THREADED
# --- static multi-threaded ---
DEFS += -DFLEXT_THREADS

else 
# --- static single-threaded ---

endif
endif

##############################################
# name of flext library
##############################################

ifdef SHARED
TYPEEXT := _
else
ifdef THREADED
TYPEEXT := _t
else
TYPEEXT := _s
endif
endif

ifdef DEBUG
MODEEXT := d
else
ifdef PROFILE
MODEEXT := p
else
MODEEXT :=
ifdef SHARED
TYPEEXT :=
endif
endif
endif

FLEXTNAME := flext-$(RTSYS)$(TYPEEXT)$(MODEEXT)

##############################################
# product name and folder
##############################################

ifndef SRCDIR
SRCDIR := .
endif

OUTSUB := $(TARGETMODE)-$(TARGETTYPE)