]> gitweb.michael.orlitzky.com - libsvgtiny.git/blob - Makefile
src/Makefile: add the new svgtiny_css.c to the list of sources
[libsvgtiny.git] / Makefile
1 #!/bin/make
2 #
3 # Makefile for libsvgtiny
4 #
5 # Copyright 2009-2015 John-Mark Bell <jmb@netsurf-browser.org>
6
7 # Component settings
8 COMPONENT := svgtiny
9 COMPONENT_VERSION := 0.1.7
10 # Default to a static library
11 COMPONENT_TYPE ?= lib-static
12
13 # Setup the tooling
14 PREFIX ?= /opt/netsurf
15 NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
16 include $(NSSHARED)/makefiles/Makefile.tools
17
18 # Reevaluate when used, as BUILDDIR won't be defined yet
19 TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
20
21 # Toolchain flags
22 WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
23 -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
24 -Wmissing-declarations -Wnested-externs -pedantic
25 # BeOS/Haiku/AmigaOS standard library headers create warnings
26 ifneq ($(BUILD),i586-pc-haiku)
27 ifneq ($(findstring amigaos,$(BUILD)),amigaos)
28 WARNFLAGS := $(WARNFLAGS) -Werror
29 endif
30 endif
31
32 CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \
33 -I$(CURDIR)/include/ -I$(CURDIR)/src \
34 $(WARNFLAGS) $(CFLAGS)
35 ifneq ($(GCCVER),2)
36 CFLAGS := $(CFLAGS) -std=c99
37 else
38 # __inline__ is a GCCism
39 CFLAGS := $(CFLAGS) -Dinline="__inline__"
40 endif
41
42 # libcss, libdom, libwapcaplet
43 ifneq ($(PKGCONFIG),)
44 CFLAGS := $(CFLAGS) \
45 $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --cflags libcss libdom libwapcaplet)
46 LDFLAGS := $(LDFLAGS) -lm \
47 $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --libs libcss libdom libwapcaplet)
48 else
49 CFLAGS := $(CFLAGS) -I$(PREFIX)/include
50 LDFLAGS := $(CFLAGS) -lcss -ldom -lwapcaplet -lexpat -lm
51 endif
52
53 include $(NSBUILD)/Makefile.top
54
55 # Extra installation rules
56 I := /$(INCLUDEDIR)
57 INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/svgtiny.h
58 INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in
59 INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT)