mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.28k stars 257 forks source link

Compiling to custom paths #194

Closed inukaze closed 7 years ago

inukaze commented 7 years ago

Hi there i trying to compile and install to custom path

Basically i have done the follow :

mkdir -p /tmp/src/mupen64plus
cd /tmp/src/mupen64plus
git clone https://github.com/mupen64plus/mupen64plus-core
git clone https://github.com/mupen64plus/mupen64plus-video-rice
git clone https://github.com/mupen64plus/mupen64plus-rsp-cxd4
git clone https://github.com/mupen64plus/mupen64plus-input-sdl
git clone https://github.com/mupen64plus/mupen64plus-audio-sdl
git clone https://github.com/mupen64plus/mupen64plus-video-z64
git clone https://github.com/mupen64plus/mupen64plus-ui-console
git clone https://github.com/mupen64plus/mupen64plus-video-glide64mk2
git clone https://github.com/mupen64plus/mupen64plus-rsp-hle
git clone https://github.com/mupen64plus/mupen64plus-video-glide64
git clone https://github.com/mupen64plus/mupen64plus-video-arachnoid
git clone https://github.com/mupen64plus/mupen64plus-rsp-z64
git clone https://github.com/mupen64plus/mupen64plus-ui-python
git clone https://github.com/mupen64plus/mupen64plus-rom
cd /tmp/src/mupen64plus/mupen64plus-core/projects/unix
TARGETDIR="/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus"

The part confuse me : use "make" itself, show the options, but not show an example of how use it.

First Try

DESTDIR="$TARGETDIR" make all
make install
install -d "/ usr / local / lib"
install: can not change permissions "/ usr/local/lib': Operation not permitted
Makefile: 631: recipe for target 'install' failed
make: *** [install] Error 1
make clean

Second Try

make DESTDIR="$TARGETDIR" all
make install
install -d "/ usr / local / lib"
install: can not change permissions "/ usr/local/lib': Operation not permitted
Makefile: 631: recipe for target 'install' failed
make: *** [install] Error 1
make clean

Third Try

make all DESTDIR="$TARGETDIR"
make install
install -d "/ usr / local / lib"
install: can not change permissions "/ usr/local/lib': Operation not permitted
Makefile: 631: recipe for target 'install' failed
make: *** [install] Error 1
make clean

Fourth Try :

PREFIX="$TARGETDIR" SHAREDIR="$TARGETDIR/share" LIBDIR="$TARGETDIR/lib" INCDIR="$TARGETDIR/include" DESTDIR="$TARGETDIR" make all
make install
install -d "/ usr / local / lib"
install: can not change permissions "/ usr/local/lib': Operation not permitted
Makefile: 631: recipe for target 'install' failed
make: *** [install] Error 1
make clean

and ever is the same error, i don't wanna to install in "/usr/local/lib" i prefer put all in a custom folder, and inside all things the emulator needs to package it to try in anothers pc and distros for not compile again.

In the past with the scripts version i put the line when i go to compile and works fine, but with the github version i dont know if i am doing something wrong. because i specify the custom path i wanna to install all.

inukaze commented 7 years ago

Ok reading this -> http://www.mupen64plus.org/wiki/index.php?title=MacOSXInstructions i not remember use the "export" xD.

Exporting Paths

export TARGETDIR="/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus"
export PREFIX="$TARGETDIR/"
export SHAREDIR="$TARGETDIR/share/"
export LIBDIR="$TARGETDIR/lib/"
export INCDIR="$TARGETDIR/include/"

Now compile it

$ make all
    CC  _obj/ai/ai_controller.o
    CC  _obj/api/callbacks.o
    CC  _obj/api/common.o
    CC  _obj/api/config.o
    CC  _obj/api/debugger.o
    CC  _obj/api/frontend.o
    CC  _obj/api/vidext.o
    CC  _obj/main/main.o
    CC  _obj/main/util.o
    CC  _obj/main/cheat.o
    CC  _obj/main/eep_file.o
    CC  _obj/main/eventloop.o
    CC  _obj/main/fla_file.o
    CC  _obj/main/md5.o
    CC  _obj/main/mpk_file.o
    CC  _obj/main/profile.o
    CC  _obj/main/rom.o
    CC  _obj/main/savestates.o
    CC  _obj/main/sdl_key_converter.o
    CC  _obj/main/sra_file.o
    CC  _obj/main/workqueue.o
    CC  _obj/memory/memory.o
    CC  _obj/pi/cart_rom.o
    CC  _obj/pi/flashram.o
    CC  _obj/pi/pi_controller.o
    CC  _obj/pi/sram.o
    CC  _obj/plugin/emulate_game_controller_via_input_plugin.o
    CC  _obj/plugin/emulate_speaker_via_audio_plugin.o
    CC  _obj/plugin/get_time_using_C_localtime.o
    CC  _obj/plugin/rumble_via_input_plugin.o
    CC  _obj/plugin/plugin.o
    CC  _obj/plugin/dummy_video.o
    CC  _obj/plugin/dummy_audio.o
    CC  _obj/plugin/dummy_input.o
    CC  _obj/plugin/dummy_rsp.o
    CC  _obj/r4300/r4300.o
    CC  _obj/r4300/cached_interp.o
    CC  _obj/r4300/cp0.o
    CC  _obj/r4300/cp1.o
    CC  _obj/r4300/exception.o
    CC  _obj/r4300/instr_counters.o
    CC  _obj/r4300/interupt.o
    CC  _obj/r4300/mi_controller.o
    CC  _obj/r4300/pure_interp.o
    CC  _obj/r4300/r4300_core.o
    CC  _obj/r4300/recomp.o
    CC  _obj/r4300/reset.o
    CC  _obj/r4300/tlb.o
    CC  _obj/rdp/fb.o
    CC  _obj/rdp/rdp_core.o
    CC  _obj/ri/rdram.o
    CC  _obj/ri/rdram_detection_hack.o
    CC  _obj/ri/ri_controller.o
    CC  _obj/rsp/rsp_core.o
    CC  _obj/si/af_rtc.o
    CC  _obj/si/cic.o
    CC  _obj/si/eeprom.o
    CC  _obj/si/game_controller.o
    CC  _obj/si/mempak.o
    CC  _obj/si/n64_cic_nus_6105.o
    CC  _obj/si/pif.o
    CC  _obj/si/rumblepak.o
    CC  _obj/si/si_controller.o
    CC  _obj/vi/vi_controller.o
    CC  _obj/osal/dynamiclib_unix.o
    CC  _obj/osal/files_unix.o
    CC  _obj/r4300/x86_64/assemble.o
    CC  _obj/r4300/x86_64/gbc.o
    CC  _obj/r4300/x86_64/gcop0.o
    CC  _obj/r4300/x86_64/gcop1.o
    CC  _obj/r4300/x86_64/gcop1_d.o
    CC  _obj/r4300/x86_64/gcop1_l.o
    CC  _obj/r4300/x86_64/gcop1_s.o
    CC  _obj/r4300/x86_64/gcop1_w.o
    CC  _obj/r4300/x86_64/gr4300.o
    CC  _obj/r4300/x86_64/gregimm.o
    CC  _obj/r4300/x86_64/gspecial.o
    CC  _obj/r4300/x86_64/gtlb.o
    CC  _obj/r4300/x86_64/regcache.o
    CC  _obj/r4300/x86_64/rjump.o
    CC  _obj/main/zip/ioapi.o
    CC  _obj/main/zip/zip.o
    CC  _obj/main/zip/unzip.o
    CXX _obj/osd/screenshot.o
    CXX _obj/osd/OGLFT.o
    CXX _obj/osd/osd.o
    LD  libmupen64plus.so.2.0.0
if [ "libmupen64plus.so.2" != "" ]; then ln -sf libmupen64plus.so.2.0.0 libmupen64plus.so.2; fi

Now i try to install in my custom path

$ make install
install -d "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/lib"
install -m 0644 -s libmupen64plus.so.2.0.0 "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/lib"
install -d "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/share"
install -m 0644 ../../data/* "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/share"
install -d "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/include"
install -m 0644 ../../src/api/m64p_*.h "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/include"
PATH="$PATH:/sbin" ldconfig -n "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/lib"
if [ ! -e "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/lib/libmupen64plus.so.2" ]; then ln -sf "libmupen64plus.so.2.0.0" "/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus/lib/libmupen64plus.so.2"; fi

Now i make it where i need it xD

inukaze commented 7 years ago

Finally i make it my own script for Installion with the follow content

#!/bin/bash

mkdir -p /tmp/src/mupen64plus
cd /tmp/src/mupen64plus
git clone https://github.com/mupen64plus/mupen64plus-core
git clone https://github.com/mupen64plus/mupen64plus-video-rice
git clone https://github.com/mupen64plus/mupen64plus-rsp-cxd4
git clone https://github.com/mupen64plus/mupen64plus-input-sdl
git clone https://github.com/mupen64plus/mupen64plus-audio-sdl
git clone https://github.com/mupen64plus/mupen64plus-video-z64
git clone https://github.com/mupen64plus/mupen64plus-ui-console
git clone https://github.com/mupen64plus/mupen64plus-video-glide64mk2
git clone https://github.com/mupen64plus/mupen64plus-rsp-hle
git clone https://github.com/mupen64plus/mupen64plus-video-glide64
git clone https://github.com/mupen64plus/mupen64plus-video-arachnoid
git clone https://github.com/mupen64plus/mupen64plus-rsp-z64
git clone https://github.com/mupen64plus/mupen64plus-ui-python
git clone https://github.com/mupen64plus/mupen64plus-rom

# Exporting Paths for each part : you must install "cpuid" on your distro, to use "native" flag.
# For make optimizations to my processor(s)
export {C,CXX}FLAGS='-O3 -march=native -mtune=native'
export OPTFLAGS='-O3 -march=native -mtune=native'

# Things :
export DEBUG=1 # Debbugin Symbols
export V=1 # Verbose Output
export PIC=1 # Position independent code
export HLEVIDEO=1 # RSP CXD4 Move task of gfx emulation to a HLE video plugins

# For The Core :
export TARGETDIR="/media/Compartido/Videojuegos/Emuladores/Nintendo64/mupen64plus"
export PREFIX="$TARGETDIR"
export SHAREDIR="$TARGETDIR/share/"
export LIBDIR="$TARGETDIR/lib/"
export INCDIR="$TARGETDIR/include/"

# For The Plugins :
export PREFIX="$TARGETDIR"
export LIBDIR="$TARGETDIR/lib/"
export PLUGINDIR="$TARGETDIR/plugin/"

# For The UI-Console :
export COREDIR="$TARGETDIR/lib/"
export PLUGINDIR="$TARGETDIR/plugin/"
export SHAREDIR="$TARGETDIR/share/"
export APIDIR="$TARGETDIR/include/"
export PREFIX="$TARGETDIR"
export BINDIR="$TARGETDIR"
export MANDIR="$TARGETDIR/share/"
export APPSDIR="$TARGETDIR"
export ICONSDIR="$TARGETDIR/share/icons/"

#001 The Core :
cd mupen64plus-core/projects/unix
make clean
make  all
make install
cd ../../..

#002 RSP Plugin - HLE :
cd mupen64plus-rsp-hle/project/unix
make clean
make all
make install
cd ../../..

#003 RSP Plugin - z64 :
cd mupen64plus-rsp-z64/project/unix
make clean
make all
make install
cd ../../..

#004 RSP Plugin - cxd4
cd mupen64plus-rsp-cxd4/project/unix
make clean
make all
make install
cd ../../..

#005 Audio Plugin - SDL
cd mupen64plus-audio-sdl/projects/unix
make clean
make all
make install
cd ../../..

#006 Input Plugin - SDL
cd mupen64plus-input-sdl/projects/unix
make clean
make all
make install
cd ../../..

#007 Video Plugin - Arachnoid
cd mupen64plus-video-arachnoid/projects/unix
make clean
make all
make install
cd ../../..

#008 Video Plugin - Glide64
cd mupen64plus-video-glide64/projects/unix
make clean
make all
make install
cd ../../..

#009 Video Plugin - Glide64mk2
cd mupen64plus-video-glide64mk2/projects/unix
make clean
make all
make install
cd ../../..

#010 Video Plugin - Rice
cd mupen64plus-video-rice/projects/unix
make clean
make all
make install
cd ../../..

#011 Video Plugin - z64
cd mupen64plus-video-z64/projects/unix
make clean
make all
make install
cd ../../..

#012 UI Console :
cd mupen64plus-ui-console/projects/unix/
make clean
make all
make install
cd ../../..

#013 UI Python :
cd mupen64plus-ui-python
sudo python setup.py install

# Create the necessary links and cache for use by the runtime linker "ld.so"
sudo ldconfig
richard42 commented 7 years ago

I'm glad you got it working. We also have build scripts which are described here:

http://mupen64plus.org/wiki/index.php?title=CompilingFromGit