diff --git a/.travis.yml b/.travis.yml index 7de9014..fe4635a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ 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 @@ -23,6 +23,7 @@ jobs: script: - export GENDEV=`pwd`/build - make sgdk_clean sgdk_build + - make sgdk_samples - stage: release to github script: - echo "Deploying to github..." @@ -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 diff --git a/Makefile b/Makefile index e38e427..0429a49 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ - +# # HINT: If makeinfo is missing on Ubuntu, install texinfo package. # -#SHELL=/bin/sh - SUDO?= sudo MGET?= wget MAKE?= make @@ -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 @@ -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); \ @@ -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 ######################################################### ######################################################### diff --git a/README.md b/README.md index 3825320..85b2c4c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/pkg/DEBIAN/control b/pkg/DEBIAN/control index 15cf0e5..81a189c 100644 --- a/pkg/DEBIAN/control +++ b/pkg/DEBIAN/control @@ -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. diff --git a/sgdk/Makefile b/sgdk/Makefile index dce37b2..79716b5 100644 --- a/sgdk/Makefile +++ b/sgdk/Makefile @@ -1,102 +1,89 @@ -GENDEV?=/opt/toolchains/gen/ -MAKE?=make +GENDEV?=/opt/gendev/ GENBIN=$(GENDEV)/bin -GENGCC_BIN=$(GENDEV)/m68k-elf/bin +GENGCC_BIN=$(GENDEV)/bin +SGDKDIR=$(CURDIR)/SGDK +SAMPLESDIR=$(SGDKDIR)/sample -CC = $(GENGCC_BIN)/m68k-elf-gcc -AR = $(GENGCC_BIN)/m68k-elf-ar -RANLIB = $(GENGCC_BIN)/m68k-elf-ranlib -OBJC = $(GENGCC_BIN)/m68k-elf-objcopy -RM = rm -f -ASMZ80 = $(GENBIN)/sjasm -BINTOS = $(GENBIN)/bintos +SGDKVER=1_3 +SGDKINSTALLDIR=$(GENDEV)/sgdk$(SGDKVER) -OPTION= -Dnologo_ -CS=$(wildcard extra_libs/*.c) -SS=$(wildcard extra_libs/*.s) -S80S=$(wildcard extra_libs/*.s80) -RESOURCES=$(CS:.c=.o) -RESOURCES+=$(SS:.s=.o) -RESOURCES+=$(S80S:.s80=.o) +all: tools $(SGDKDIR) $(SGDKDIR)/libmd.a -extrasmd.a_OBJS=$(RESOURCES) - -INCS = -Iextra_incs -Isgdk-read-only/include -Isgdk-read-only/inc -Isgdk-read-only/res -FLAGS = $(OPTION) -m68000 -Wall -O1 -c -fomit-frame-pointer $(INCS) -FLAGSZ80 = -isrc -iextra_incs -Isgdk-read-only/include - -all: tools sgdk-read-only sgdk-read-only/src/libmd.a - -tools: sgdk-read-only - cd sgdk-read-only/tools/bintos/src && \ +tools: $(SGDKDIR) + cd $(SGDKDIR)/tools/bintos/src && \ gcc -o bintos bintos.c && cp bintos $(GENDEV)/bin/. - cd sgdk-read-only/tools/pcmtoraw/src && \ + cd $(SGDKDIR)/tools/pcmtoraw/src && \ gcc -o pcmtoraw pcmtoraw.c && cp pcmtoraw $(GENDEV)/bin/. - cd sgdk-read-only/tools/sizebnd/src && \ + cd $(SGDKDIR)/tools/sizebnd/src && \ gcc -o sizebnd sizebnd.c && cp sizebnd $(GENDEV)/bin/. - cd sgdk-read-only/tools/wavtoraw/src && \ + cd $(SGDKDIR)/tools/wavtoraw/src && \ gcc -o wavtoraw wavtoraw.c -lm && cp wavtoraw $(GENDEV)/bin/. - cd sgdk-read-only/tools/xgmtool && \ + cd $(SGDKDIR)/tools/xgmtool && \ make -f ../../../files/Makefile.xgmtool && cp out/xgmtool $(GENDEV)/bin/. - cd sgdk-read-only/tools/rescomp && \ - patch -u -p0 < ../../../files/rescomp.diff && \ + cd $(SGDKDIR)/tools/rescomp && \ make -f ../../../files/Makefile.rescomp && cp out/rescomp $(GENDEV)/bin/. + #patch -u -p0 < ../../../files/rescomp.diff && \ + # + cp $(SGDKDIR)/bin/lz4w.jar $(GENDEV)/bin/. patch: - cd sgdk-read-only && git diff * > ../files/sgdk.diff - #svn diff sgdk-read-only > files/sgdk.diff + cd $(SGDKDIR) && git diff * > ../files/sgdk.diff -sgdk-read-only: - git clone https://github.com/kubilus1/SGDK.git sgdk-read-only - #svn co http://sgdk.googlecode.com/svn/trunk sgdk-read-only - #patch -u -p0 < files/sgdk.diff - -sgdk-read-only/libmd.a: - cd sgdk-read-only && ln -sf ../files/Makefile.sgdk_lib . - cd sgdk-read-only && $(MAKE) -f Makefile.sgdk_lib +prep: + cd $(SGDKDIR) && patch -u -p1 < ../files/sgdk.diff -install: tools sgdk-read-only sgdk-read-only/libmd.a - echo "Install" - cd sgdk-read-only && $(MAKE) -f Makefile.sgdk_lib install - install -b sgdk-read-only/md.ld $(GENDEV)/ldscripts/sgdk.ld - #install -b files/sgdk.ld $(GENDEV)/ldscripts/sgdk.ld - -%.a: $(extasmd.a_OBJS) - $(RM) $@ - $(AR) cru $@ $($@_OBJS) - $(RANLIB) $@ - -%.o80: %.s80 - $(ASMZ80) $(FLAGSZ80) $< $@ out.lst - -%.s: %.o80 - $(BINTOS) $< +$(SGDKDIR): + git clone https://github.com/Stephane-D/SGDK.git + cd $(SGDKDIR) && patch -u -p1 < ../files/sgdk.diff + #cp files/makefile.vars $(SGDKDIR)/. + #git clone https://github.com/kubilus1/SGDK.git $(SGDKDIR) + #patch -u -p0 < files/sgdk.diff -%.o: %.c - $(CC) $(FLAGS) -c $< -o $@ +$(SGDKDIR)/libmd.a: $(SGDKDIR) + cd $(SGDKDIR) && ln -sf ../files/Makefile.sgdk_lib . + cd $(SGDKDIR) && $(MAKE) -f Makefile.sgdk_lib -%.o: %.s - $(CC) $(FLAGS) -c $< -o $@ +$(SGDKINSTALLDIR): + mkdir -p $@ + cd $(GENDEV) && ln -sf sgdk$(SGDKVER) sgdk -extras: $(extrasmd.a_OBJS) libextrasmd.a - echo "Extras" - #cp libextrasmd.a $(GENDEV)/m68k-elf/lib - cp extra_libs/*.o $(GENDEV)/m68k-elf/lib - cp extra_incs/*.h $(GENDEV)/m68k-elf/include +install: tools $(SGDKDIR)/libmd.a $(SGDKINSTALLDIR) + echo "Install" + mkdir -p $(GENDEV)/sgdk/src + mkdir -p $(GENDEV)/sgdk/inc + mkdir -p $(GENDEV)/sgdk/lib + mkdir -p $(GENDEV)/sgdk/res + mkdir -p $(GENDEV)/sgdk/mkfiles + #cd $(SGDKDIR) && $(MAKE) -f Makefile.sgdk_lib install + cp $(SGDKDIR)/md.ld $(GENDEV)/sgdk/. + #cp -r ./skeleton $(GENDEV)/. + cp $(SGDKDIR)/inc/* $(GENDEV)/sgdk/inc/. + cp -r $(SGDKDIR)/src/boot $(GENDEV)/sgdk/src/. + cp -r $(SGDKDIR)/res/* $(GENDEV)/sgdk/res/. + cp $(GENDEV)/lib/libgcc.a $(GENDEV)/sgdk/lib/. + cp $(SGDKDIR)/libmd.a $(GENDEV)/sgdk/lib/. + cp $(SGDKDIR)/makefile.gen $(GENDEV)/sgdk/mkfiles/. + cp files/makefile.vars $(GENDEV)/sgdk/mkfiles/. + +SAMPLES=$(wildcard $(SAMPLESDIR)/*/out) +SAMPLEROMS=$(addsuffix /rom.bin,$(SAMPLES)) +CLEANSAMPLES=$(SAMPLES) + +.PHONY: $(CLEANSAMPLES) +sample_clean: $(CLEANSAMPLES) + @echo "Done cleaning samples" + +$(CLEANSAMPLES): + cd $@/.. && make -f $(GENDEV)/sgdk/mkfiles/makefile.gen clean + +samples: $(SAMPLEROMS) + @echo "All samples built" + +$(SAMPLEDIR)/%/out/rom.bin: + echo "ROM $@" + cd $@/../../ && make -f $(GENDEV)/sgdk/mkfiles/makefile.gen clean: echo "Clean" - -rm -rf sgdk-read-only - #-cd sgdk-read-only && $(MAKE) -f Makefile.sgdk_lib clean - #cd sgdk-read-only && git checkout src - #cd sgdk-read-only && git checkout tools - #-svn revert -R sgdk-read-only/src - #-svn revert -R sgdk-read-only/tools - -rm extra_libs/*.o - -rm extra_libs/*.a - -rm libextrasmd.a - -purge: clean - echo "Purge" - rm -rf sgdk-read-only + -rm -rf $(SGDKDIR) diff --git a/sgdk/files/makefile.vars b/sgdk/files/makefile.vars new file mode 100644 index 0000000..670ca5e --- /dev/null +++ b/sgdk/files/makefile.vars @@ -0,0 +1,39 @@ +PATH := $(GENDEV)/bin:$(PATH) +GENGCC_BIN= $(GENDEV)/bin +GENBIN= $(GENDEV)/bin + +GDK= $(GENDEV)/sgdk +LIB= $(GENDEV)/sgdk/lib +LIBSRC= $(GENDEV)/sgdk/src +LIBRES= $(GENDEV)/sgdk/res +LIBINCLUDE= $(GENDEV)/sgdk/inc + +SRC= src +RES= res +INCLUDE= inc + +#MACCER= $(BIN)/mac68k + +MKDIR= mkdir +ECHO= echo +CP= cp +SHELL= sh + +CC = $(GENGCC_BIN)/m68k-elf-gcc +AS = $(GENGCC_BIN)/m68k-elf-as +AR = $(GENGCC_BIN)/m68k-elf-ar +LD = $(GENGCC_BIN)/m68k-elf-ld +RANLIB = $(GENGCC_BIN)/m68k-elf-ranlib +OBJCPY = $(GENGCC_BIN)/m68k-elf-objcopy +BINTOS = $(GENBIN)/bintos +RESCOMP= $(GENBIN)/rescomp +XGMTOOL= $(GENBIN)/xgmtool +PCMTORAW = $(GENBIN)/pcmtoraw +WAVTORAW = $(GENBIN)/wavtoraw +SIZEBND = $(GENBIN)/sizebnd +ASMZ80 = $(GENBIN)/zasm + +RM = rm -f +NM = nm +NM2WCH = nm2wch +MKISOFS = mkisofs diff --git a/sgdk/files/sgdk.diff b/sgdk/files/sgdk.diff index 1bccba2..f530a27 100644 --- a/sgdk/files/sgdk.diff +++ b/sgdk/files/sgdk.diff @@ -1,37 +1,219 @@ -Index: makelib.gen -=================================================================== ---- makelib.gen (revision 206) -+++ makelib.gen (working copy) -@@ -1,3 +1,4 @@ -+GDK=$(CURDIR) - BIN= $(GDK)/bin - LIB= $(GDK)/lib +diff --git a/makefile.gen b/makefile.gen +index b9d7877..07d96af 100644 +--- a/makefile.gen ++++ b/makefile.gen +@@ -24,6 +24,8 @@ BINTOS= $(BIN)/bintos + RESCOMP= $(BIN)/rescomp + MKDIR= $(BIN)/mkdir -@@ -5,17 +6,17 @@ - RES= $(GDK)/res - INCLUDE= $(GDK)/inc ++include $(GENDEV)/sgdk/mkfiles/makefile.vars ++ + SRC_C= $(wildcard *.c) + SRC_C+= $(wildcard $(SRC)/*.c) + SRC_S= $(wildcard *.s) +diff --git a/res/libres.h b/res/libres.h +index 1f6155d..f31e5b5 100644 +--- a/res/libres.h ++++ b/res/libres.h +@@ -1,9 +1,9 @@ +-#ifndef _D__APPS_SGDK_RES_LIBRES_H_ +-#define _D__APPS_SGDK_RES_LIBRES_H_ ++#ifndef _RES_LIBRES_H_ ++#define _RES_LIBRES_H_ + + extern const Bitmap logo_lib; + extern const TileSet font_lib; + extern const Palette font_pal_lib; + extern const u8 stop_xgm[172]; + +-#endif // _D__APPS_SGDK_RES_LIBRES_H_ ++#endif // _RES_LIBRES_H_ +index 451564b..37b72b7 100644 +--- a/sample/hs_effect/src/boot/rom_head.c ++++ b/sample/hs_effect/src/boot/rom_head.c +@@ -1,6 +1,6 @@ + #include "types.h" + +- ++__attribute__((externally_visible)) + const struct + { + char console[16]; /* Console Name (16) */ +index 451564b..37b72b7 100644 +--- a/sample/joytest/src/boot/rom_head.c ++++ b/sample/joytest/src/boot/rom_head.c +@@ -1,6 +1,6 @@ + #include "types.h" + +- ++__attribute__((externally_visible)) + const struct + { + char console[16]; /* Console Name (16) */ +index 24d748b..ab8eb69 100644 +--- a/sample/sound/res/resources.res ++++ b/sample/sound/res/resources.res +@@ -7,7 +7,7 @@ XGM midnight "midnight.vgm" + VGM roadrash "roadrash.vgm" + VGM sonic1 "sonic1.vgm" + VGM bapcm_vgm "bad_apple_pcm.vgm" +-TFM music_tfd "music_tfd.tfd" 1 ++#TFM music_tfd "music_tfd.tfd" 1 + BIN music_mvs "music_mvs.mvs" 256 --SHELL= $(BIN)/sh --RM= $(BIN)/rm --CP= $(BIN)/cp --AR= $(BIN)/ar --CC= $(BIN)/gcc -+SHELL= sh -+RM= rm -+CP= cp -+AR= m68k-elf-ar -+CC= m68k-elf-gcc - ECHO= echo --OBJCPY= $(BIN)/objcopy --ASMZ80= $(BIN)/sjasm --SIZEBND= $(BIN)/sizebnd --BINTOS= $(BIN)/bintos --RESCOMP= $(BIN)/rescomp -+OBJCPY= m68k-elf-objcopy -+ASMZ80= sjasm -+SIZEBND= sizebnd -+BINTOS= bintos -+RESCOMP= rescomp + WAV india_8k "india_8k.wav" 0 8000 +diff --git a/sample/sound/src/main.c b/sample/sound/src/main.c +index 117e891..498160b 100644 +--- a/sample/sound/src/main.c ++++ b/sample/sound/src/main.c +@@ -568,19 +568,6 @@ static void joyEvent(u16 joy, u16 changed, u16 state) + break; + } + +- case Z80_DRIVER_TFM: +- { +- if (changed & state & BUTTON_A) +- { +- SND_startPlay_TFM(music_tfd); +- } +- if (changed & state & BUTTON_START) +- { +- SND_stopPlay_TFM(); +- } +- break; +- } +- + case Z80_DRIVER_VGM: + { + if (changed & state & BUTTON_X) +diff --git a/src/z80_drv1.h b/src/z80_drv1.h +index 06adade..a2da7b8 100644 +--- a/src/z80_drv1.h ++++ b/src/z80_drv1.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_DRV1_H_ +-#define _Z80_DRV1_H_ +- +-extern const u8 z80_drv1[0xB2B]; +- +-#endif // _Z80_DRV1_H_ ++#ifndef _Z80_DRV1_H_ ++#define _Z80_DRV1_H_ ++ ++extern const u8 z80_drv1[0xB2B]; ++ ++#endif // _Z80_DRV1_H_ +diff --git a/src/z80_drv2.h b/src/z80_drv2.h +index 3598de1..7ef3aba 100644 +--- a/src/z80_drv2.h ++++ b/src/z80_drv2.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_DRV2_H_ +-#define _Z80_DRV2_H_ +- +-extern const u8 z80_drv2[0xE00]; +- +-#endif // _Z80_DRV2_H_ ++#ifndef _Z80_DRV2_H_ ++#define _Z80_DRV2_H_ ++ ++extern const u8 z80_drv2[0xE00]; ++ ++#endif // _Z80_DRV2_H_ +diff --git a/src/z80_drv3.h b/src/z80_drv3.h +index 8b35866..94c8000 100644 +--- a/src/z80_drv3.h ++++ b/src/z80_drv3.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_DRV3_H_ +-#define _Z80_DRV3_H_ +- +-extern const u8 z80_drv3[0xA69]; +- +-#endif // _Z80_DRV3_H_ ++#ifndef _Z80_DRV3_H_ ++#define _Z80_DRV3_H_ ++ ++extern const u8 z80_drv3[0xA69]; ++ ++#endif // _Z80_DRV3_H_ +diff --git a/src/z80_mvs.h b/src/z80_mvs.h +index 031a90f..661cbb0 100644 +--- a/src/z80_mvs.h ++++ b/src/z80_mvs.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_MVS_H_ +-#define _Z80_MVS_H_ +- +-extern const u8 z80_mvs[0xA5B]; +- +-#endif // _Z80_MVS_H_ ++#ifndef _Z80_MVS_H_ ++#define _Z80_MVS_H_ ++ ++extern const u8 z80_mvs[0xA5B]; ++ ++#endif // _Z80_MVS_H_ +diff --git a/src/z80_tfm.h b/src/z80_tfm.h +index 31e35a0..fe6fed3 100644 +--- a/src/z80_tfm.h ++++ b/src/z80_tfm.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_TFM_H_ +-#define _Z80_TFM_H_ +- +-extern const u8 z80_tfm[0x69D]; +- +-#endif // _Z80_TFM_H_ ++#ifndef _Z80_TFM_H_ ++#define _Z80_TFM_H_ ++ ++extern const u8 z80_tfm[0x69D]; ++ ++#endif // _Z80_TFM_H_ +diff --git a/src/z80_xgm.h b/src/z80_xgm.h +index 167307c..49364d2 100644 +--- a/src/z80_xgm.h ++++ b/src/z80_xgm.h +@@ -1,6 +1,6 @@ +-#ifndef _Z80_XGM_H_ +-#define _Z80_XGM_H_ +- +-extern const u8 z80_xgm[0x1700]; +- +-#endif // _Z80_XGM_H_ ++#ifndef _Z80_XGM_H_ ++#define _Z80_XGM_H_ ++ ++extern const u8 z80_xgm[0x1700]; ++ ++#endif // _Z80_XGM_H_ +diff --git a/tools/rescomp/inc/tools.h b/tools/rescomp/inc/tools.h +index 320fd16..20ef97e 100644 +--- a/tools/rescomp/inc/tools.h ++++ b/tools/rescomp/inc/tools.h +@@ -1,6 +1,11 @@ + #ifndef _TOOLS_H_ + #define _TOOLS_H_ + ++#if __linux ++#define stricmp strcasecmp ++#define strnicmp strncasecmp ++#define strupr toupper ++#endif + + #define FALSE 0 + #define TRUE 1 +diff --git a/tools/rescomp/src/tools.c b/tools/rescomp/src/tools.c +index 8160f36..c94dbcf 100644 +--- a/tools/rescomp/src/tools.c ++++ b/tools/rescomp/src/tools.c +@@ -797,7 +797,7 @@ static int appack(char* fin, char* fout) + strcat(cmd, "\" \""); + strcat(cmd, fout); + strcat(cmd, "\""); +- strcat(cmd, " -s"); ++ //strcat(cmd, " -s"); + + printf("Executing %s\n", cmd); - SRC_C= $(wildcard $(SRC)/*.c) - SRC_S= $(wildcard $(SRC)/*.s) diff --git a/sgdk/skeleton/Makefile b/sgdk/skeleton/Makefile index 262eaba..b41f42e 100644 --- a/sgdk/skeleton/Makefile +++ b/sgdk/skeleton/Makefile @@ -1,9 +1,9 @@ GENDEV?=/opt/toolchains/gen/ -GCC_VER?=4.8.2 +GCC_VER?=6.3.0 MAKE?=make LIB?=lib -GENGCC_BIN=$(GENDEV)/m68k-elf/bin +GENGCC_BIN=$(GENDEV)/bin GENBIN=$(GENDEV)/bin CC = $(GENGCC_BIN)/m68k-elf-gcc @@ -28,13 +28,13 @@ MKISOFS = mkisofs SCD_LOADER = scd/LukeProjectCD OPTION = -INCS = -I. -I$(GENDEV)/m68k-elf/include -I$(GENDEV)/m68k-elf/m68k-elf/include -Isrc -Ires +INCS = -I. -I$(GENDEV)/m68k-elf/include -I$(GENDEV)/m68k-elf/include -Isrc -Ires CCFLAGS = $(OPTION) -m68000 -Wall -O2 -c -fomit-frame-pointer HWCCFLAGS = $(OPTION) -m68000 -Wall -O1 -c -fomit-frame-pointer Z80FLAGS = -vb2 ASFLAGS = -m68000 --register-prefix-optional #LIBS = -L$(GENDEV)/m68k-elf/lib -L$(GENDEV)/m68k-elf/lib/gcc/m68k-elf/4.8.2 -L$(GENDEV)/m68k-elf/m68k-elf/lib -lmd -lc -lgcc -lnosys -lm -LIBS = -L$(GENDEV)/m68k-elf/lib -L$(GENDEV)/m68k-elf/lib/gcc/m68k-elf/* -L$(GENDEV)/m68k-elf/m68k-elf/lib -lmd -lnosys +LIBS = -L$(GENDEV)/m68k-elf/lib -L$(GENDEV)/m68k-elf/lib/gcc/m68k-elf/* -lmd -lnosys LINKFLAGS = -T $(GENDEV)/ldscripts/sgdk.ld -Map=output.map -nostdlib SCDLINKFLAGS = -T scd/mdcd.ld -nostdlib ARCHIVES = $(GENDEV)/m68k-elf/lib/libmd.a @@ -48,7 +48,7 @@ ARCHIVES = $(GENDEV)/m68k-elf/lib/libmd.a #ARCHIVES += $(GENDEV)/m68k-elf/lib/gcc/m68k-elf/$(GCC_VER)/libgcc.a #endif -ARCHIVES += $(GENDEV)/m68k-elf/$(LIB)/gcc/m68k-elf/$(GCC_VER)/libgcc.a +ARCHIVES += $(GENDEV)/$(LIB)/gcc/m68k-elf/$(GCC_VER)/libgcc.a RESOURCES= BOOT_RESOURCES= diff --git a/toolchain/Makefile b/toolchain/Makefile index dc59976..a385b48 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -54,6 +54,7 @@ $(WORKDIR)/build-newlib: build-gcc-2: cd $(WORKDIR)/build-gcc && ../gcc-$(GCC_VERSION)/configure --target=m68k-elf --prefix=$(BUILDDIR) --with-newlib --disable-libssp --disable-tls --enable-threads=single --enable-languages=c --with-cpu=m68000 --disable-werror --disable-nls --disable-multilib make -C $(WORKDIR)/build-gcc all install DESTDIR= $(LOG) + cp $(BUILDDIR)/lib/gcc/m68k-elf/$(GCC_VERSION)/libgcc.a $(BUILDDIR)/lib/. build-ldscripts: $(BUILDDIR)/ldscripts $(BUILDDIR)/ldscripts: