Share

Corewar

Tracker: Patches

5 Makefile for OS X - ID: 1857992
Last Update: Comment added ( nobody )

This makefile will allow pmars to compile on OS X.
I suggest including it in the distribution as Makefile.OSX

# OS X makefile
CC = gcc # req. for linux
#CC = cc # if you don't have gcc
# Configuration options:
#
# No. Name Incompatible with Description
# (1) -DSERVER 2 disables cdb debugger (koth
server
# version)
# (2) -DGRAPHX 1 enables platform specific core

# graphics
# (3) -DKEYPRESS only for curses display on
SysV:
# enter cdb upon keypress (use
if
# Ctrl-C doesn't work)
# (4) -DEXT94 ICWS'94 + SEQ,SNE,NOP,*,{,}
# (5) -DSMALLMEM 16-bit addresses, less memory
# (6) -DXWINGRAPHX 1 X-Windows graphics (UNIX)
# (7) -DPERMUTATE enables -P switch

# COMPILER FLAGS FOR COMPILATION OF OS X
# YOU _MUST_ HAVE THE APPLE DEVELOPER TOOLS AND X11 INSTALLED.
# BOTH ARE AVALIABLE ON YOUR OS X DVD.

CFLAGS = -O -Dunix -DEXT94 -DXWINGRAPHX -DPERMUTATE
LFLAGS = -x
# LIB = -lcurses -ltermlib # enable this one for curses display
# LIB = -lvgagl -lvga # enable this one for Linux/SVGA
LIB = -L/usr/X11R6/lib -lX11 # enable this one for X11

.SUFFIXES: .o .c .c~ .man .doc .6
MAINFILE = pmars

HEADER = global.h config.h asm.h sim.h
OBJ1 = pmars.o asm.o eval.o disasm.o cdb.o sim.o pos.o
OBJ2 = clparse.o global.o token.o
OBJ3 = str_eng.o

all: flags $(MAINFILE)

flags:
@echo Making $(MAINFILE) with compiler flags $(CFLAGS)
@echo If this fails make sure you have the "Developer Tools" and "X11"
installed from your OS X DVD.
@echo If you will not be able to use the graphical display unless you run
pmars in X11.

$(MAINFILE): $(OBJ1) $(OBJ2) $(OBJ3)
@echo Linking $(MAINFILE)
@$(CC) -o $(MAINFILE) $(OBJ1) $(OBJ2) $(OBJ3) $(LIB)
@strip $(MAINFILE)
@echo done

token.o asm.o disasm.o: asm.h

sim.o cdb.o pos.o disasm.o: sim.h

sim.o: curdisp.c uidisp.c lnxdisp.c xwindisp.c

xwindisp.c: xwindisp.h pmarsicn.h

lnxdisp.c: lnxdisp.h

$(OBJ1) $(OBJ2) $(OBJ3): Makefile config.h global.h

.c.o:
@echo Compiling $*.o
@$(CC) $(CFLAGS) -c $*.c


clean:
rm -f $(OBJ1) $(OBJ2) $(OBJ3) core


Nobody/Anonymous ( nobody ) - 2007-12-25 06:23

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2007-12-25 06:26
Sender: nobody

Logged In: NO

Oh lord, It messed up all the tabs.

Here is the diff.

================
[17:21:32] ollie@shodan src$diff Makefile Makefile.OSX
19c19,23
< CFLAGS = -O -DEXT94 -DXWINGRAPHX -DPERMUTATE
---
> # COMPILER FLAGS FOR COMPILATION OF OS X
> # YOU _MUST_ HAVE THE APPLE DEVELOPER TOOLS AND X11 INSTALLED.
> # BOTH ARE AVALIABLE ON YOUR OS X DVD.
>
> CFLAGS = -O -Dunix -DEXT94 -DXWINGRAPHX -DPERMUTATE
23c27
< LIB = -L/usr/X11R6/lib -lX11 # enable this one for X11
---
> LIB = -L/usr/X11R6/lib -lX11 # enable this one for X11
36a41,42
>[TAB]@echo If this fails make sure you have the "Developer Tools" and
"X11" installed from your OS X DVD.
>[TAB]@echo If you will not be able to use the graphical display unless
you run pmars in X11.
=====================


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.