forked from kwxsp/libxively
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.include
57 lines (47 loc) · 1.57 KB
/
Makefile.include
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
SHELL := /bin/sh
CC ?= gcc
AR ?= ar
XI_BUILD_TYPE ?= debug
ifndef XI_OVERRIDE_CFLAGS
XI_WARN_CFLAGS ?= -Wall -Wextra
XI_CFLAGS += -std=gnu99 -Iinclude -fstrict-aliasing
XI_CFLAGS += $(XI_WARN_CFLAGS) $(XI_EXTRA_CFLAGS)
ifeq ($(XI_BUILD_TYPE),release)
XI_OPTLEVEL ?= -O2
XI_CFLAGS += $(XI_OPTLEVEL) -combine -fwhole-program
endif
ifeq ($(XI_BUILD_TYPE),debug)
XI_OPTLEVEL ?= -O0
XI_CFLAGS += $(XI_OPTLEVEL)
XI_DEBUG_OUTPUT ?= 1
XI_DEBUG_ASSERT ?= 1
XI_CFLAGS += -DXI_DEBUG_OUTPUT=$(XI_DEBUG_OUTPUT)
XI_CFLAGS += -DXI_DEBUG_ASSERT=$(XI_DEBUG_ASSERT)
endif
ifdef XI_DEBUG_PRINTF
XI_CFLAGS += -DXI_DEBUG_PRINTF=$(XI_DEBUG_PRINTF)
endif
XI_CFLAGS += $(foreach constant,$(XI_OVERRIDE_CONSTANTS),-D$(constant))
ifdef XI_OPTIMISE
XI_CFLAGS += $(foreach constant,$(XI_OPTIMISE),-DXI_OPT_$(constant))
endif
XI_USER_AGENT ?= '"libxively-$(XI_COMM_LAYER)/0.1.x-$(shell git rev-parse --short HEAD)"'
XI_CFLAGS += -DXI_USER_AGENT=$(XI_USER_AGENT)
else
XI_CFLAGS := $(XI_OVERRIDE_CFLAGS)
$(warning "Overriden XI_CFLAGS with $(XI_OVERRIDE_CFLAGS)")
endif # XI_OVERRIDE_CFLAGS
ifndef XI_OVERRIDE_ARFLAGS
XI_ARFLAGS := -rs
else
XI_ARFLAGS := $(XI_OVERRIDE_ARFLAGS)
$(warning "Overriden XI_ARFLAGS with $(XI_OVERRIDE_ARFLAGS)")
endif # XI_OVERRIDE_ARFLAGS
XI_OUTPUT ?= $(LIBXIVELY)/
XI_OBJDIR := $(XI_OUTPUT)/obj
XI_BINDIR := $(XI_OUTPUT)/bin
XI ?= $(XI_OBJDIR)/libxively.a
XI_OBJECTS = $(XI_SOURCES:.c=.o)
XI_DEPENDS = $(XI_SOURCES:.c=.d)
XI_OBJS = $(addprefix $(XI_OBJDIR)/,$(XI_OBJECTS))
XI_DEPS = $(addprefix $(XI_OBJDIR)/,$(XI_DEPENDS))