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.
This commit is contained in:
parent
3152ff0512
commit
c204e47b72
|
@ -7,10 +7,5 @@ script:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3
|
- sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3
|
||||||
- make -f GNUmakefile
|
- make -f GNUmakefile
|
||||||
- make -f GNUmakefile example EXAMPLE=histogram
|
- make -f GNUmakefile examples
|
||||||
|
- make -f GNUmakefile test
|
||||||
# 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
|
|
||||||
|
|
15
GNUmakefile
15
GNUmakefile
|
@ -8,11 +8,6 @@ MAKEFLAGS += --no-print-directory
|
||||||
OUTDIR = out
|
OUTDIR = out
|
||||||
OBJDIR = .obj
|
OBJDIR = .obj
|
||||||
|
|
||||||
# default install prefix is /usr
|
|
||||||
ifndef prefix
|
|
||||||
prefix=/usr
|
|
||||||
endif
|
|
||||||
|
|
||||||
# MAME does this so :/
|
# MAME does this so :/
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
OS = windows
|
OS = windows
|
||||||
|
@ -64,12 +59,10 @@ example: libui
|
||||||
|
|
||||||
# TODO examples rule? --> That's it right ?
|
# TODO examples rule? --> That's it right ?
|
||||||
examples:
|
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
|
.PHONY: examples
|
||||||
|
|
||||||
install: libui
|
install:
|
||||||
cp out/libui.so $(DESTDIR)$(prefix)/lib/libui.so.0
|
@$(MAKE) -f build/GNUmakefile.libui install inlibuibuild=1
|
||||||
ln -s libui.so.0 $(DESTDIR)$(prefix)/lib/libui.so
|
|
||||||
cp ui.h ui_unix.h $(DESTDIR)$(prefix)/include/ui.h
|
|
||||||
|
|
||||||
|
|
|
@ -39,3 +39,6 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include build/GNUbase$(TOOLCHAIN).mk
|
include build/GNUbase$(TOOLCHAIN).mk
|
||||||
|
|
||||||
|
# install rule is OS specific
|
||||||
|
include $(OS)/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/
|
|
@ -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/
|
|
@ -0,0 +1,3 @@
|
||||||
|
install:
|
||||||
|
@echo "No install for windows !"
|
||||||
|
@exit 1
|
Loading…
Reference in New Issue