summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6f9ec56285bc24509d16d98f66f2ab55ab6c4918 (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
# Component settings
COMPONENT := ttf2f
COMPONENT_VERSION := 0.0.4
# We produce an application binary
COMPONENT_TYPE := binary

# Default frontend is cli
FRONTEND ?= cli

# Setup the tooling
include build/makefiles/Makefile.tools

# Toolchain flags
WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
	-Wmissing-declarations -Wnested-externs -Werror #-pedantic
CFLAGS := $(CFLAGS) -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
	-I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) -Dasm="__asm"

# Freetype2
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
  ifneq ($(PKGCONFIG),)
    CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) freetype2 --cflags)
    LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) freetype2 --libs)
  else
    CFLAGS := $(CFLAGS) -I$(PREFIX)/include/freetype2
    LDFLAGS := $(LDFLAGS) -lfreetype -lz
  endif
endif

# OSLib (RISC OS target only)
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
  ifeq ($(TARGET),riscos)
    CFLAGS := $(CFLAGS) -I$(PREFIX)/include -static
    LDFLAGS := $(LDFLAGS) -lOSLib32 -lOSLibSupport32 -static
  endif
endif

include build/makefiles/Makefile.top

# Extra installation rules