From f3cbf9332ec5622a7b9706482b6bcb9e7fd76b12 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 26 May 2018 12:55:57 +0200 Subject: [PATCH] [Travis] Updated the script to now use pacman, caching optimization - The Makefile now doesn't rely on wii_rules anymore. --- .travis.yml | 43 ++++++++++++++++++++++++------------------- Makefile | 13 +++++++++++-- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc4ee69..ece1da7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,42 @@ -language: c -sudo: false +language: cpp -os: - - linux +os: linux +sudo: false +dist: trusty env: global: - - DEVKITPRO=$HOME/devkitPro - - DEVKITPPC=${DEVKITPRO}/devkitPPC + - DEVKITPRO=/opt/devkitpro + - DEVKITPPC=/opt/devkitpro/devkitPPC + - PORTLIBREPOS=$HOME/portlibrepos cache: directories: - - ${DEVKITPRO} + - "$HOME/.local" + - "$PORTLIBREPOS" + - "$DEVKITPRO" addons: apt: packages: - p7zip-full -before_install: +before_install: + - mkdir -p "${PORTLIBREPOS}" - mkdir -p "${DEVKITPRO}" - - wget https://downloads.devkitpro.org/devkitPPC_r29-1-x86_64-linux.tar.bz2 -O devkitPPC-linux.tar.bz2 - - wget https://github.com/Maschell/dynamic_libs/archive/lib.tar.gz -O dynamic_libs.tar.gz - - wget https://github.com/Maschell/libutils/archive/master.tar.gz -O libutils.tar.gz + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb -O /tmp/devkitpro-pacman.deb; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i /tmp/devkitpro-pacman.deb; fi + - yes | sudo dkp-pacman -Syu devkitPPC install: - - tar -xjf devkitPPC-linux.tar.bz2 -C ${DEVKITPRO}/ - - tar -xzvf dynamic_libs.tar.gz - - tar -xzvf libutils.tar.gz - - 7z x -y ./dynamic_libs-lib/libs/portlibs.zip -o${DEVKITPRO} - - (cd dynamic_libs-lib && make && make install) - - (cd libutils-master && make && make install) + - cd $PORTLIBREPOS + - ((git clone https://github.com/Maschell/dynamic_libs.git -b lib && (7z x -y ./dynamic_libs/libs/portlibs.zip -o${DEVKITPRO})) || (cd dynamic_libs && git pull)) + - (git clone https://github.com/Maschell/libutils.git || (cd libutils && git pull)) + - (cd dynamic_libs && ((make -j8 | grep -c "built ... ") && make install && echo "installed" ) || (echo "no need for make install" && make)) + - (cd libutils && ((make -j8 | grep -c "built ... ") && make install && echo "installed" ) || (echo "no need for make install" && make)) + +before_script: + - cd $TRAVIS_BUILD_DIR/ script: - - make - \ No newline at end of file + - make && make install \ No newline at end of file diff --git a/Makefile b/Makefile index 0b71371..7d7668a 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,19 @@ ifeq ($(strip $(DEVKITPRO)),) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPRO") endif -include $(DEVKITPPC)/wii_rules - +export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH) export PORTLIBS := $(DEVKITPRO)/portlibs/ppc +PREFIX := powerpc-eabi- + +export AS := $(PREFIX)as +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy + +include $(DEVKITPPC)/base_rules + #--------------------------------------------------------------------------------- # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code