From b795cda79e813d8d4651cf3d1105b58a4c4b7a36 Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 01:42:54 +0100 Subject: [PATCH] Makefile: Added examples + install rules. --- GNUmakefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index a0c871f3..162eae52 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -8,6 +8,11 @@ MAKEFLAGS += --no-print-directory OUTDIR = out OBJDIR = .obj +# default install prefix is /usr +ifndef prefix + prefix=/usr +endif + # MAME does this so :/ ifeq ($(OS),Windows_NT) OS = windows @@ -57,4 +62,14 @@ test: libui example: libui @$(MAKE) -f build/GNUmakefile.example inlibuibuild=1 -# TODO examples rule? +# TODO examples rule? --> That's it right ? +examples: + for d in $$(ls examples); do $(MAKE) -f GNUmakefile example EXAMPLE=$$d ; done + +.PHONY: examples + +install: libui + cp out/libui.so $(DESTDIR)$(prefix)/lib/libui.so.0 + ln -s libui.so.0 $(DESTDIR)$(prefix)/lib/libui.so + cp ui.h ui_unix.h $(DESTDIR)$(prefix)/include/ui.h +