Skip to content

Support for Apple Sillicon Architectures #9

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 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**.o
.vscode
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
#
# $Log:$
#
CC= gcc # gcc or g++
CC= gcc # gcc or g++

CFLAGS=-m32 -g -Wall -DNORMALUNIX -DLINUX -DSDL # -DUSEASM
LDFLAGS=-L/usr/lib/i386-linux-gnu/
LIBS=-lSDL #-lnsl -lm
LIBS= -L/opt/homebrew/opt/sdl12-compat/lib \
-lSDL

INCLUDES=-I/opt/homebrew/opt/sdl12-compat/include \
-I/usr/local/include

CFLAGS=-m32 -g -c -w -DSDL

# subdirectory for objects
O=linux
O=macos

# not too sophisticated dependency
OBJS= \
Expand Down Expand Up @@ -81,14 +85,14 @@ all: $(O)/sdl_doom

clean:
rm -f *.o *~ *.flc
rm -f linux/*
rm -f $(O)/*

$(O)/sdl_doom: $(OBJS) $(O)/i_main.o
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(O)/i_main.o \
-o $(O)/sdl_doom $(LIBS)
$(CC) $(CFLAGS) $(OBJS) $(O)/i_main.o \
-o $(O)/sdl_doom $(LIBS) $(INCLUDES)

$(O)/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

#############################################################
#
Expand Down
5 changes: 5 additions & 0 deletions d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ static const char rcsid[] = "$Id: d_main.c,v 1.8 1997/02/03 22:45:09 b1 Exp $";
#include <fcntl.h>
#endif

#ifdef __APPLE__
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#endif

#include "doomdef.h"
#include "doomstat.h"
Expand Down
2 changes: 2 additions & 0 deletions i_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
#include <sys/ioctl.h>

// Linux voxware output.
#ifdef LINUX
#include <linux/soundcard.h>
#endif

// Timer stuff. Experimental.
#include <time.h>
Expand Down
4 changes: 1 addition & 3 deletions m_bbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
#ifdef __GNUG__
#pragma implementation "m_bbox.h"
#endif
#include "doomtype.h"
#include "m_bbox.h"




void M_ClearBox (fixed_t *box)
{
box[BOXTOP] = box[BOXRIGHT] = MININT;
Expand Down
2 changes: 2 additions & 0 deletions m_bbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#ifndef __M_BBOX__
#define __M_BBOX__

#ifdef LINUX
#include <values.h>
#endif

#include "m_fixed.h"

Expand Down
2 changes: 1 addition & 1 deletion m_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ rcsid[] = "$Id: m_misc.c,v 1.6 1997/02/03 22:45:10 b1 Exp $";
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>

#include "d_englsh.h"
#include <ctype.h>


Expand Down
3 changes: 3 additions & 0 deletions r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
#include <alloca.h>
#endif

#ifdef __APPLE__
#include <alloca.h>
#endif

#include "r_data.h"

Expand Down
11 changes: 11 additions & 0 deletions w_wad.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ rcsid[] = "$Id: w_wad.c,v 1.5 1997/02/03 16:47:57 b1 Exp $";
#define O_BINARY 0
#endif

#ifdef __APPLE__
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <alloca.h>
#define O_BINARY 0
#endif

#include "doomtype.h"
#include "m_swap.h"
#include "i_system.h"
Expand Down