diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..beb2b46 --- /dev/null +++ b/Makefile @@ -0,0 +1,69 @@ +#!/bin/make +# +# Makefile for nslayout +# +# Copyright 2009-2015 John-Mark Bell <jmb@netsurf-browser.org> + +# Component settings +COMPONENT := nslayout +COMPONENT_VERSION := 0.0.0 +# Default to a static library +COMPONENT_TYPE ?= lib-static + +# Setup the tooling +PREFIX ?= /opt/netsurf +NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem +include $(NSSHARED)/makefiles/Makefile.tools + +# Reevaluate when used, as BUILDDIR won't be defined yet +TESTRUNNER = $(BUILDDIR)/test_testrunner$(EXEEXT) + +# Toolchain flags +WARNFLAGS := -Wall -Wextra -W -Wundef -Wpointer-arith -Wcast-align \ + -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ + -Wmissing-declarations -Wnested-externs +# BeOS/Haiku standard library headers issue warnings +ifneq ($(BUILD),i586-pc-haiku) + WARNFLAGS := $(WARNFLAGS) -Werror +endif + +CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \ + -I$(CURDIR)/include/ -I$(CURDIR)/src \ + $(WARNFLAGS) $(CFLAGS) +ifneq ($(GCCVER),2) + CFLAGS := $(CFLAGS) -std=c99 +else + # __inline__ is a GCCism + CFLAGS := $(CFLAGS) -Dinline="__inline__" +endif + +# libwapcaplet, libparserutils, libcss, libdom +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) + ifneq ($(PKGCONFIG),) + CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) \ + libwapcaplet libparserutils libcss libdom --cflags) + LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) \ + libwapcaplet libparserutils libcss libdom --libs) + else + CFLAGS := $(CFLAGS) -I$(PREFIX)/include + LDFLAGS := $(LDFLAGS) -lparserutils -lwapcaplet -lcss -ldom + endif +endif + +include $(NSBUILD)/Makefile.top + +ifeq ($(WANT_TEST),yes) + ifneq ($(PKGCONFIG),) + TESTCFLAGS := $(TESTCFLAGS) $(shell $(PKGCONFIG) --cflags check) + TESTLDFLAGS := $(TESTLDFLAGS) $(shell $(PKGCONFIG) --libs check) + else + TESTLDFLAGS := $(TESTLDFLAGS) -lcheck + endif +endif + +# Extra installation rules +I := /$(INCLUDEDIR)/lib$(COMPONENT) + +INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/lib$(COMPONENT)/libnslayout.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT) |