Skip to content

Commit

Permalink
Merge pull request #31 from kubilus1/sgdk13
Browse files Browse the repository at this point in the history
Sgdk13 Upgrade
  • Loading branch information
kubilus1 authored Jul 8, 2017
2 parents 14ba7cb + 0603dfd commit 2196d6c
Show file tree
Hide file tree
Showing 9 changed files with 420 additions and 210 deletions.
21 changes: 5 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ jobs:
- make clean
- stage: build toolchain
script:
- travis_wait 90 make toolchain_clean toolchain_build
- make toolchain_clean toolchain_build
- stage: build tools
script:
- make tools_clean tools_build
- stage: build sgdk
script:
- export GENDEV=`pwd`/build
- make sgdk_clean sgdk_build
- make sgdk_samples
- stage: release to github
script:
- echo "Deploying to github..."
Expand All @@ -31,21 +32,9 @@ jobs:
provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
skip_cleanup: true
file: gendev.txz
file:
- dist/gendev_*.txz
- dist/gendev_*_all.deb
on:
tags: true
repo: kubilus1/gendev

#script:
# - make setup
#- travis_wait 90 make toolchain_build GENDEV=".toolchain" SUDO=""
# - cd work
#- travis_wait 90 make -f ../gen_gcc/makefile-gen build-m68k-binutils
#- travis_wait 90 make -f ../gen_gcc/makefile-gen build-m68k-gcc-pass1
#- travis_wait 90 make -f ../gen_gcc/makefile-gen build-m68k-newlib
#- travis_wait 90 make -f ../gen_gcc/makefile-gen build-m68k-gcc-pass2
#- cd ..
#- export GENDEV=`pwd`/.toolchain
#- make $GENDEV/ldscripts
#- make tools
#- make sgdk_build
32 changes: 15 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

#
# HINT: If makeinfo is missing on Ubuntu, install texinfo package.
#

#SHELL=/bin/sh

SUDO?= sudo
MGET?= wget
MAKE?= make
Expand All @@ -13,6 +11,8 @@ BUILDDIR?=$(CURDIR)/build
GENDEV?=/opt/gendev/
TOPDIR=$(CURDIR)

VER=0.3.0

PATH := $(BUILDDIR)/bin:$(PATH)

build: toolchain_build tools_build sgdk_build
Expand All @@ -33,6 +33,9 @@ tools_build:
tools_clean:
cd tools && make tools_clean

sgdk_samples:
cd sgdk && make sample_clean samples

install:
if [ -w /opt ]; then \
mkdir -p $(GENDEV); \
Expand All @@ -45,41 +48,36 @@ install:
#$(SUDO) chmod 777 $@
cp -r $(BUILDDIR)/* $(GENDEV)/.

release: deb dist/gendev.txz
release: deb txz
echo "Release"

dist:
mkdir -p dist

dist/gendev.txz: dist
tar -C $(BUILDDIR) -cJf dist/gendev.txz .
txz: dist/gendev_$(VER).txz
dist/gendev_$(VER).txz: dist pkg_build
tar -C pkg_build -cJf dist/gendev_$(VER).txz opt

pkg_build:
mkdir -p pkg_build/opt/gendev
cp -r $(BUILDDIR)/* pkg_build/opt/gendev/.
cp -r pkg/* pkg_build/.

deb: dist dist/gendev_1_all.deb
dist/gendev_1_all.deb: pkg_build
dpkg-deb -Zxz -z9 --build pkg_build .
deb: dist dist/gendev_$(VER)_all.deb
dist/gendev_$(VER)_all.deb: pkg_build
sed -i 's/##VER##/$(VER)/g' pkg_build/DEBIAN/control
cd dist && dpkg-deb -Zxz -z9 --build $(TOPDIR)/pkg_build .

sgdk_build: $(GENDEV)/m68k-elf/lib/libmd.a
$(GENDEV)/m68k-elf/lib/libmd.a:
sgdk_build:
cd sgdk && GENDEV=$(BUILDDIR) make install
cp -r sgdk/skeleton $(BUILDDIR)/.

sgdk_clean:
- cd sgdk && make clean
- rm $(GENDEV)/m68k-elf/lib/libmd.a

clean: tools_clean toolchain_clean sgdk_clean
-rm -rf $(BUILDDIR)
-rm -rf pkg_build
-rm -rf dist
#-rm -rf work/gcc-$(GCC_VERSION)
#-rm -rf work/binutils-$(BINUTILS_VERSION)
#-rm -rf work/build-*
#-cd sgdk && make clean

#########################################################
#########################################################
Expand Down
124 changes: 69 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,85 +7,99 @@ Genesis development. Gendev is not intended to replace, but to be a companion pr

BASIC INSTRUCTIONS
==================
The quickest way to get going would be to simply install one of the release
packages for this project. Both a 'txz' and 'deb' package are provided.

$ git clone https://github.com/kubilus1/gendev.git
$ cd gendev
$ make
USAGE
=====

This will build the entire GCC toolchain for genesis development, plus SGDK.
Build takes about 1 hour on my system. Note this will only create C libraries for the 68K processor. For a 32x SH2
development:
SETUP
-----
Set the GENDEV environment variable to the install location of the project.
Typcially this should be '/opt/gendev'

$ make 32x
```
$ export GENDEV=/opt/gendev
```

Now I want to create a project ...
You may, perhaps, add this into your bash profile for ease of use.

$ cp -r /opt/toolchains/gen/skeleton mycoolproject
$ cd mycoolproject
BUILDING SGDK PROJECTS
----------------------

*type type type*
You may enter your project directory, or perhaps SGDK sample directory and
build the projects by specifying the provided makefile.gen.

$ make
```
$ cd myaweseomeproject
$ make -f $GENDEV/sgdk/mkfiles/makefilegen clean all
```

----
You may wish, alternatively, to copy the makefile directly to your project.

Troubleshooting and FAQ
=======================

Build Requirements
------------------
On Ubuntu for instance you may want to install the following:

sudo apt-get install build-essential texinfo git

makeinfo is missing
-------------------

Try installing the 'texinfo' package. On Ubuntu this would be 'sudo apt-get
install texinfo'

How do I build this on *BSD?
----------------------------

Use gmake. Try the following to build the framework:
PROJECT STRUCTURE
=================

MAKE=gmake MGET=fetch gmake
* gendev - Top level where things generally start from. Start building and
packaging here.
* gendev/toolchain - Where the GCC toolchain build lives
* gendev/sgdk - Where the sgdk patches and setup lives
* gendev/tools - Where support tools live
* gendev/examples - Old example projects
* gendev/extras - Old helper projects

And for sgdk
TOOLCHAIN BUILDING
==================

cd sgdk; gmake install
The toolchain is now setup with Travis-CI for continuous integration. This
should ease porting and allow better validation of incoming patches.

This doesn't work/There is an obvious issue
-------------------------------------------
You may decide to build the full toolchain by making sure you have the texinfo
package installed, and then:

Please let me know and perhaps file an issue.
```
$ cd gendev
$ make
```
... and wait about 45 minutes or so.

The .travis-ci.yml script is a good place to look to see how the individual
build stages are executed.


Project Structure
DESIGN PHILOSOPHY
=================

* gendev/Makefile


Makefile for setting up the required build tools. Running this is enough for
a basic development environment.


* gendev/sgdk/Makefile

Makefile for setting up SGDK for use on Linux
Initally this project was a quick hack pulling together GCC build chain
scripts from ChillyWilly, and slapping together some hacks to get SGDK to
compile under linux.

In effect this was at least 2 projects in one:

* gendev/sgdk/skeleton
1. A m68k build chain geared towards Genesis/Megadrive development
2. An SGDK port to linux.

Some basic files to assist in building SGDK project under Linux.
The original approaches led to encouraging users to rebuild toolchains, long
build times, and large file footprint. Plus it was very difficult to
maintain.

I am attempting to:

* examples
1. Not necessarilly require building everything
2. Shorten the build time
3. Hook up with continuous integration tools
4. Reduce the footprint
5. Organize better
6. Minimize changes to SGDK to make porting version easier

A few examples using this toolkit

* extras
NOTES:
======

Other tools and utilities useful for development purposes.
* The 32x stuff is currently deprecated. I may create steps to build this
toolchain again in the future.
* All testing is done on 64bit Ubuntu installations, specifically Zesty and
Trusty. Your mileage may vary with other distros.
* This project is still way too messy, and hopefully I have time to cleanup
cruft bit by bit.
* I welcome patches and pull requests.
4 changes: 2 additions & 2 deletions pkg/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: gendev
Version: 1
Version: ##VER##
Section: devel
Priority: optional
Maintainer: Matt Kubilus (mattkubilus)
Depends: texinfo
Architecture: all
Homepage: http://code.google.com/p/gendev/
Homepage: https://github.com/kubilus1/gendev
Description: Sega Genesis development on *nix.
Loading

0 comments on commit 2196d6c

Please sign in to comment.