From b795cda79e813d8d4651cf3d1105b58a4c4b7a36 Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 01:42:54 +0100 Subject: [PATCH 1/6] 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 + From 48bf6d2b3732e45405c09cd946b22e26bb1a7e45 Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 01:43:38 +0100 Subject: [PATCH 2/6] Adding travis file. --- .travis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..34d2ea90 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ + +dist: trusty + +language: cpp +script: + - cat /etc/lsb-release + - sudo apt-get update + - sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3 + - make -f GNUmakefile + - make -f GNUmakefile example EXAMPLE=histogram + +# Only working things are added here... Some interesting commands would be: +# - make -f GNUmakefile examples +# - make -f GNUmakefile test +# +# But they both won't work From cfcbe9859fe0991e0a42437bc1e18ede76494f8a Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 01:45:32 +0100 Subject: [PATCH 3/6] Tiny warning fix. Why not switch to -Werror by the way ? --- unix/group.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unix/group.c b/unix/group.c index 8f40c4f8..d0bdd451 100644 --- a/unix/group.c +++ b/unix/group.c @@ -53,8 +53,9 @@ void uiGroupSetChild(uiGroup *g, uiControl *child) if (g->child != NULL) childRemove(g->child); g->child = newChildWithBox(child, uiControl(g), g->container, g->margined); - if (g->child != NULL) + if (g->child != NULL) { uiControlQueueResize(uiControl(g)); + } } int uiGroupMargined(uiGroup *g) From 3152ff0512856f0c4267e0a03d3cc85195f5a07a Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 01:48:13 +0100 Subject: [PATCH 4/6] Travis: Triggering build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34d2ea90..d0c9470c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ +# This makes us use Ubuntu 14 instead of 12 dist: trusty language: cpp script: - - cat /etc/lsb-release - sudo apt-get update - sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3 - make -f GNUmakefile From c204e47b7268fd27a72f1de8e382fa9fe673f341 Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 23:19:14 +0100 Subject: [PATCH 5/6] Various fixes around makefiles * $PREFIX is uppercase (I have no idea why I put it lowercase before). * "install" rules is OS specific and moved to new OS specific files. So that they can be included last. * "examples" rule defines the list of examples to execute. * Travis launches the "test" rule. --- .travis.yml | 9 ++------- GNUmakefile | 15 ++++----------- build/GNUmakefile.libui | 3 +++ darwin/GNUinstall.mk | 9 +++++++++ unix/GNUinstall.mk | 8 ++++++++ windows/GNUinstall.mk | 3 +++ 6 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 darwin/GNUinstall.mk create mode 100644 unix/GNUinstall.mk create mode 100644 windows/GNUinstall.mk diff --git a/.travis.yml b/.travis.yml index d0c9470c..0d4309bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,5 @@ script: - sudo apt-get update - sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3 - make -f GNUmakefile - - make -f GNUmakefile example EXAMPLE=histogram - -# Only working things are added here... Some interesting commands would be: -# - make -f GNUmakefile examples -# - make -f GNUmakefile test -# -# But they both won't work + - make -f GNUmakefile examples + - make -f GNUmakefile test diff --git a/GNUmakefile b/GNUmakefile index 162eae52..319ff4d4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -8,11 +8,6 @@ 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 @@ -64,12 +59,10 @@ example: libui # TODO examples rule? --> That's it right ? examples: - for d in $$(ls examples); do $(MAKE) -f GNUmakefile example EXAMPLE=$$d ; done + @$(MAKE) -f GNUmakefile example EXAMPLE=histogram + #@$(MAKE) -f GNUmakefile example EXAMPLE=controlgallery .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 - +install: + @$(MAKE) -f build/GNUmakefile.libui install inlibuibuild=1 diff --git a/build/GNUmakefile.libui b/build/GNUmakefile.libui index 936fc2b6..a4666720 100644 --- a/build/GNUmakefile.libui +++ b/build/GNUmakefile.libui @@ -39,3 +39,6 @@ else endif include build/GNUbase$(TOOLCHAIN).mk + +# install rule is OS specific +include $(OS)/GNUinstall.mk diff --git a/darwin/GNUinstall.mk b/darwin/GNUinstall.mk new file mode 100644 index 00000000..13da37f5 --- /dev/null +++ b/darwin/GNUinstall.mk @@ -0,0 +1,9 @@ +ifndef PREFIX + PREFIX=/usr +endif + +# Incorrect for Mac Os X, this should be easy to fix +install: $(OUT) + cp $(OUT) $(DESTDIR)$(PREFIX)/lib/libui.0.dylib + ln -s libui.so.0 $(DESTDIR)$(PREFIX)/lib/libui.so + cp ui.h ui_$(OS).h $(DESTDIR)$(PREFIX)/include/ diff --git a/unix/GNUinstall.mk b/unix/GNUinstall.mk new file mode 100644 index 00000000..634dbc06 --- /dev/null +++ b/unix/GNUinstall.mk @@ -0,0 +1,8 @@ +ifndef PREFIX + PREFIX=/usr +endif + +install: $(OUT) + cp $(OUT) $(DESTDIR)$(PREFIX)/lib/libui.so.0 + ln -fs libui.so.0 $(DESTDIR)$(PREFIX)/lib/libui.so + cp ui.h ui_$(OS).h $(DESTDIR)$(PREFIX)/include/ diff --git a/windows/GNUinstall.mk b/windows/GNUinstall.mk new file mode 100644 index 00000000..1d783c01 --- /dev/null +++ b/windows/GNUinstall.mk @@ -0,0 +1,3 @@ +install: + @echo "No install for windows !" + @exit 1 From bdded52f5ede489057c55dcb63e6a2cfa33ac2a2 Mon Sep 17 00:00:00 2001 From: Florent Clairambault Date: Fri, 1 Jan 2016 23:20:49 +0100 Subject: [PATCH 6/6] Mac Os X install rule: Tiny fix. --- darwin/GNUinstall.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin/GNUinstall.mk b/darwin/GNUinstall.mk index 13da37f5..41df8837 100644 --- a/darwin/GNUinstall.mk +++ b/darwin/GNUinstall.mk @@ -5,5 +5,5 @@ endif # Incorrect for Mac Os X, this should be easy to fix install: $(OUT) cp $(OUT) $(DESTDIR)$(PREFIX)/lib/libui.0.dylib - ln -s libui.so.0 $(DESTDIR)$(PREFIX)/lib/libui.so + ln -s libui.0.dylib $(DESTDIR)$(PREFIX)/lib/libui.dylib cp ui.h ui_$(OS).h $(DESTDIR)$(PREFIX)/include/