From: Michael Orlitzky Date: Sun, 19 Nov 2023 13:32:01 +0000 (-0500) Subject: examples/GNUmakefile: add a GNUmakefile for the example program X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e99915289a4d1f1f607241e0fc2179266718886f;p=libsvgtiny.git examples/GNUmakefile: add a GNUmakefile for the example program This should simplify building it a bit, both against the system copy and against a development repo. We use the name GNUmakefile (as opposed to Makefile) to avoid interacting with the netsurf build system. --- diff --git a/examples/GNUmakefile b/examples/GNUmakefile new file mode 100644 index 0000000..1c287fe --- /dev/null +++ b/examples/GNUmakefile @@ -0,0 +1,20 @@ +CC ?= cc + +# Handle libsvgtiny flags and libs separately in case it's missing. If +# you're building against a local (non-system) libsvgtiny, then the +# absence of its pkg-config file should not be a fatal error. +SVGTINY_CPPFLAGS := $(shell pkg-config --silence-errors --cflags libsvgtiny) +OTHER_CPPFLAGS := $(shell pkg-config --cflags cairo x11) +CPPFLAGS += $(SVGTINY_CPPFLAGS) $(OTHER_CPPFLAGS) + +SVGTINY_LIBS := $(shell pkg-config --silence-errors --libs libsvgtiny) +OTHER_LIBS := $(shell pkg-config --libs cairo x11) -lm +LIBS += $(SVGTINY_LIBS) $(OTHER_LIBS) + +all: svgtiny_display_x11 +.c: + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) + +.PHONY : clean +clean: + rm -f svgtiny_display_x11