8000 A few fixes on paths when crosscompiling from macOS by alkama · Pull Request #7 · leifo/haujobb-amiga · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A few fixes on paths when crosscompiling from macOS #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
6 changes: 3 additions & 3 deletions demo/hellodemo/build/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ VPATH = $(SRCDIR)
#vpath %.asm src

CFLAGS = -O=23999 -cpu=68060 -fpu=68060 -DAMIGA -speed -c99 -k -DSYNC_PLAYER -DNEED_STRDUP
ASFLAGS = -Fhunk -m68020 -m68882 -Ic:/vbcc/NDK39/Include/include_i
ASFLAGS = -Fhunk -m68020 -m68882 -I$(VBCC)/NDK39/Include/include_i
LDFLAGS =

INCDIR = ../../shared
Expand All @@ -59,8 +59,8 @@ LD = vlink
# Add includes and libraries.
#INCDIR := $(INCDIR) ./ "$(VBCC)/posix/include" "$(VBCC)/targets/m68k-amigaos/include"
#LIBDIR := $(LIBDIR) ./ "$(VBCC)/targets/m68k-amigaos/lib"
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(INCDIR) ./
LIBDIR := C:\\VBCC/targets/m68k-amigaos/lib
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(VBCC)/NDK39/Include/include_h $(INCDIR) ./
LIBDIR := $(VBCC)/targets/m68k-amigaos/lib

# Strip everything if there's no d 10000 ebug infos
ifeq ($(findstring -g, $(CFLAGS)), -g)
Expand Down
3 changes: 2 additions & 1 deletion demo/hellodemo/hellodemo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ CONFIG += console
OBJECTS_DIR=.obj
MOC_DIR=.moc

DEFINES += WOS_ON_PC=1

win32 {
DEFINES += _USE_MATH_DEFINES=1
DEFINES += _CRT_SECURE_NO_WARNINGS=1
Expand Down Expand Up @@ -62,7 +64,6 @@ HEADERS += \
SOURCES += \
src/main.c \
src/stars/starseffect.c \
src/main.c \
src/movetable/movetableeffect.c \
src/pictures/pictureeffect.c

Expand Down
2 changes: 1 addition & 1 deletion demo/hellodemo/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void mainDemo()
// 23: 220x180x12
// 24: 320x180x5 (OCS)

#if !defined (WIN32) && !defined(linux)
#if !defined (WOS_ON_PC) && !defined (WIN32) && !defined(linux)
g_vbitimer+=0 ;//66*50;
while (wosCheckExit()==0)
{
Expand Down
2 changes: 1 addition & 1 deletion demo/hellodemo/src/movetable/movetableeffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define MOVETABLEEFFECT_H

void movetableEffectInit();
void movetableEffectOn(time);
void movetableEffectOn(int time);
void movetableEffectRender(int time, int xtab, int ytab);
void movetableEffectRelease();
unsigned int* movetablePalette();
Expand Down
2 changes: 1 addition & 1 deletion demo/hellodemo/src/stars/starseffect.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef STARSEFFECT_H
#define STARSFFECT_H
#define STARSEFFECT_H

void starsEffectInit();
void starsEffectOn(int startTime);
Expand Down
4 changes: 2 additions & 2 deletions demo/movetable/build/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ LD = vlink
# Add includes and libraries.
#INCDIR := $(INCDIR) ./ "$(VBCC)/posix/include" "$(VBCC)/targets/m68k-amigaos/include"
#LIBDIR := $(LIBDIR) ./ "$(VBCC)/targets/m68k-amigaos/lib"
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(INCDIR) ./
LIBDIR := C:\\VBCC/targets/m68k-amigaos/lib
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(VBCC)/NDK39/Include/include_h $(INCDIR) ./
LIBDIR := $(VBCC)/targets/m68k-amigaos/lib

# Strip everything if there's no debug infos
ifeq ($(findstring -g, $(CFLAGS)), -g)
Expand Down
7 changes: 5 additions & 2 deletions demo/movetable/movetable.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ MOC_DIR=.moc
#MOC_DIR=R:/moc
#PRECOMPILED_DIR=R:\

DEFINES += WOS_ON_PC=1

win32 {
DEFINES += _USE_MATH_DEFINES=1
DEFINES += _CRT_SECURE_NO_WARNINGS=1
Expand All @@ -34,15 +36,16 @@ INCLUDEPATH += $$(QTDIR)/include/QtGui
INCLUDEPATH += $$(QTDIR)/include/QtNetwork
INCLUDEPATH += $$(QTDIR)/include/QtOpenGL

LIBS += -lopengl32
win32 {
LIBS += -lopengl32
}

OTHER_FILES += \
build/makefile

# source

HEADERS += \
src/vertex.h \
src/movetableeffect.h \
../shared/math/imath.h \
../shared/image/tga.h
Expand Down
2 changes: 1 addition & 1 deletion demo/movetable/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void mainDemo()

wosSetMode(8, screenBuffer, movetablePalette(), 256);

#ifndef WIN32
#ifndef WOS_ON_PC
while (wosCheckExit()==0)
{
time= g_vbitimer;
Expand Down
4 changes: 2 additions & 2 deletions demo/picture/build/makefile
10000
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ LD = vlink
# Add includes and libraries.
#INCDIR := $(INCDIR) ./ "$(VBCC)/posix/include" "$(VBCC)/targets/m68k-amigaos/include"
#LIBDIR := $(LIBDIR) ./ "$(VBCC)/targets/m68k-amigaos/lib"
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(INCDIR) ./
LIBDIR := C:\\VBCC/targets/m68k-amigaos/lib
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(VBCC)/NDK39/Include/include_h $(INCDIR) ./
LIBDIR := $(VBCC)/targets/m68k-amigaos/lib

# Strip everything if there's no debug infos
ifeq ($(findstring -g, $(CFLAGS)), -g)
Expand Down
6 changes: 5 additions & 1 deletion demo/picture/picture.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ MOC_DIR=.moc
#MOC_DIR=R:/moc
#PRECOMPILED_DIR=R:\

DEFINES += WOS_ON_PC=1

win32 {
DEFINES += _USE_MATH_DEFINES=1
DEFINES += _CRT_SECURE_NO_WARNINGS=1
Expand All @@ -34,7 +36,9 @@ INCLUDEPATH += $$(QTDIR)/include/QtGui
INCLUDEPATH += $$(QTDIR)/include/QtNetwork
INCLUDEPATH += $$(QTDIR)/include/QtOpenGL

LIBS += -lopengl32
win32 {
LIBS += -lopengl32
}

OTHER_FILES += \
build/makefile
Expand Down
2 changes: 1 addition & 1 deletion demo/picture/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void mainDemo()
int time= 0;

wosSetMode(8, screenBuffer, g_currentPal, 0);
#ifndef WIN32
#ifndef WOS_ON_PC
while (wosCheckExit()==0)
{
time= g_vbitimer;
Expand Down
6 changes: 3 additions & 3 deletions demo/screenmodes/build/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ VPATH = $(SRCDIR)
#vpath %.c src
#vpath %.asm src

CFLAGS = -O=23999 -cpu=68060 -fpu=68060 -DAMIGA -speed -k
CFLAGS = -O=23999 -cpu=68060 -fpu=68060 -DAMIGA -c99 -speed -k
ASFLAGS =
LDFLAGS =

Expand All @@ -54,8 +54,8 @@ LD = vlink
# Add includes and libraries.
#INCDIR := $(INCDIR) ./ "$(VBCC)/posix/include" "$(VBCC)/targets/m68k-amigaos/include"
#LIBDIR := $(LIBDIR) ./ "$(VBCC)/targets/m68k-amigaos/lib"
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(INCDIR) ./
LIBDIR := C:\\VBCC/targets/m68k-amigaos/lib
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(VBCC)/NDK39/Include/include_h $(INCDIR) ./
LIBDIR := $(VBCC)/targets/m68k-amigaos/lib

# Strip everything if there's no debug infos
ifeq ($(findstring -g, $(CFLAGS)), -g)
Expand Down
6 changes: 5 additions & 1 deletion demo/screenmodes/screenmodes.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ MOC_DIR=.moc
#MOC_DIR=R:/moc
#PRECOMPILED_DIR=R:\

DEFINES += WOS_ON_PC=1

win32 {
DEFINES += _USE_MATH_DEFINES=1
DEFINES += _CRT_SECURE_NO_WARNINGS=1
Expand All @@ -34,7 +36,9 @@ INCLUDEPATH += $$(QTDIR)/include/QtGui
INCLUDEPATH += $$(QTDIR)/include/QtNetwork
INCLUDEPATH += $$(QTDIR)/include/QtOpenGL

LIBS += -lopengl32
win32 {
LIBS += -lopengl32
}

OTHER_FILES += \
build/makefile
Expand Down
2 changes: 1 addition & 1 deletion demo/screenmodes/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void mainDemo()
int time= 0;

//wosSetMode(8, screenBuffer, g_currentPal, 256);
#ifndef WIN32
#ifndef WOS_ON_PC
while (wosCheckExit()==0)
{
time= g_vbitimer;
Expand Down
3 changes: 3 additions & 0 deletions demo/shared/tools/malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@

// windows
#include <stdlib.h>

#if defined (WIN32) || defined(linux)
#include <malloc.h>
#endif

#endif

Expand Down
2 changes: 1 addition & 1 deletion demo/shared/tools/mem32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "math/imath.h"

#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
#include <memory.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion demo/shared/wos/wos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ WosQt::~WosQt()

waveOutReset(mHandle);
waveOutClose(mHandle);
#endif

delete[] mAudioBuffer;
#endif
}

void SetupHam15Bit(unsigned int* bp0, unsigned int* bp1, int rows)
Expand Down
4 changes: 2 additions & 2 deletions demo/stars/build/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ LD = vlink
# Add includes and libraries.
#INCDIR := $(INCDIR) ./ "$(VBCC)/posix/include" "$(VBCC)/targets/m68k-amigaos/include"
#LIBDIR := $(LIBDIR) ./ "$(VBCC)/targets/m68k-amigaos/lib"
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(INCDIR) ./
LIBDIR := C:\\VBCC/targets/m68k-amigaos/lib
INCDIR := $(VBCC)/posix/include $(VBCC)/targets/m68k-amigaos/include $(VBCC)/NDK39/Include/include_h $(INCDIR) ./
LIBDIR := $(VBCC)/targets/m68k-amigaos/lib

# Strip everything if there's no debug infos
ifeq ($(findstring -g, $(CFLAGS)), -g)
Expand Down
2 changes: 1 addition & 1 deletion demo/stars/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void mainDemo()

wosSetMode(8, screenBuffer, starsPalette(), 256);

#ifndef WIN32
#ifndef WOS_ON_PC
while (wosCheckExit()==0)
{
time= g_vbitimer;
Expand Down
2 changes: 1 addition & 1 deletion demo/stars/src/starseffect.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef STARSEFFECT_H
#define STARSFFECT_H
#define STARSEFFECT_H

void starsInit();
void starsRender(int time);
Expand Down
7 changes: 5 additions & 2 deletions demo/stars/stars.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ MOC_DIR=.moc
#MOC_DIR=R:/moc
#PRECOMPILED_DIR=R:\

DEFINES += WOS_ON_PC=1

win32 {
DEFINES += _USE_MATH_DEFINES=1
DEFINES += _CRT_SECURE_NO_WARNINGS=1
Expand All @@ -34,15 +36,16 @@ INCLUDEPATH += $$(QTDIR)/include/QtGui
INCLUDEPATH += $$(QTDIR)/include/QtNetwork
INCLUDEPATH += $$(QTDIR)/include/QtOpenGL

LIBS += -lopengl32
win32 {
LIBS += -lopengl32
}

OTHER_FILES += \
build/makefile

# source

HEADERS += \
src/vertex.h \
src/starseffect.h \

SOURCES += \
Expand Down
49 changes: 49 additions & 0 deletions readme.macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Quick guide to install and use the Haujobb Amiga Framework on macOS

## Download:

### To Crosscompile with makefiles you need 3 files:
* (1) VBCC Binary for macOS and (2) the target m68k-amigaos
* http://sun.hasenbraten.de/vbcc/
* (3) the NDK 3.9
* http://www.haage-partner.de/download/AmigaOS/NDK39.lha

### Misc utilities:
* To easily decompress lha files and tons of other archives, you can use Keka
* https://www.keka.io/en/

## Install:
* Choose a directory for C5B7 the toolchain
* Extract the VBCC binaries, target and NDK39 there, the layout should be:
```
./toolchain
├── bin
│ └── ...
├── config
│ ├── aos68k
│ ├── aos68km
│ ├── aos68kr
│ └── vc.config (<<< see below)
├── NDK39
│ ├── Documentation
│ ├── Examples
│ ├── Include
│ └── ...
└── targets
└── m68k-amigaos
└── ...
```
* make a `config/vc.config` by copying the `aos68k` file and replace all occurences of:
* `vincludeos3:` by `$VBCC/targets/m68k-amigaos/include`
* `vlibos3:` by `$VBCC/targets/m68k-amigaos/lib/`
* the `-rm=delete quiet %s` line by `-rm=rm -f %s`
* the `-rmv=delete %s` line by `-rmv=rm %s`

* setup the `$VBCC` environment variable, pointing to your chosen toolchain folder, in your user profile (`.profile` or `.bashrc` or `.zshrc` or whatever your shell is)
```
export VBCC=[PATH TO YOUR VBCC TOOLCHAIN FOLDER OF CHOICE]
```

You should now be able to compile any example by running `make` in their respective "build" folder

For the rest of the usages, please refer to the main documentation
2 changes: 1 addition & 1 deletion wos/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AS = vasmm68k_mot

ASFLAGS = -Fhunk -m68020 -m68882 -Ic:/vbcc/NDK39/Include/include_i
ASFLAGS = -Fhunk -m68020 -m68882 -I$(VBCC)/NDK39/Include/include_i

all: subdir wickedlink.o wickedquicklink.o wostest

Expand Down
0