Skip to content

Commit

Permalink
MegaZeux 2.80h release.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelva1984 committed Aug 11, 2008
1 parent 98c1ee0 commit 1b766c6
Show file tree
Hide file tree
Showing 105 changed files with 7,904 additions and 5,501 deletions.
38 changes: 10 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
#
# Slave MegaZeux makefile
#
include Makefile.platform
include Makefile.in

SUBDIRS = contrib/gdm2s3m/src contrib/libmodplug/src src

all: subdir
include Makefile.platform

subdir:
list='$(SUBDIRS)'; \
for subdir in $$list; do \
pwd=`pwd`; \
cd $$subdir && make && cd $$pwd; \
done;
cd contrib/libmodplug/src && make && cd ../../..
cd contrib/gdm2s3m/src && make && cd ../../..
cd src && make && cd ..

clean:
list='$(SUBDIRS)'; \
for subdir in $$list; do \
pwd=`pwd`; \
cd $$subdir && make clean && cd $$pwd; \
done;
cd contrib/libmodplug/src && make clean && cd ../../..
cd contrib/gdm2s3m/src && make clean && cd ../../..
cd src && make clean && cd ..

install:
mkdir -p ${PREFIX}/share/megazeux && \
chown root:root ${PREFIX}/share/megazeux && \
chmod 0755 ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
install -o root -m 0644 config.txt /etc/megazeux-config && \
install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
ln -sf ${TARGET} ${PREFIX}/bin/megazeux
distclean: clean
rm -f src/config.h
cp -f arch/Makefile.dist Makefile.platform
32 changes: 20 additions & 12 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,32 @@
CC = gcc
CXX = g++

# path to gdm2s3m sources
GDM2S3M = contrib/gdm2s3m/src
MODPLUG = contrib/libmodplug/src

# default target name
TARGET = mzx280g
VERSION = 2.80g
TARGET = mzx280h
VERSION = 2.80h

ifdef DEBUG
# debug C++ flags
CXXFLAGS = -g -funsigned-char -Wall -DMZX_VERSION=\"${VERSION}\" -DDEBUG
ifneq ("${DATE}", "0")
VERSTRING = ${VERSION}\ \(`date +%Y%m%d`\)
else
# optimised C++ flags
CXXFLAGS = -O2 -funsigned-char -ffast-math -Wall -DMZX_VERSION=\"${VERSION}\"
VERSTRING = ${VERSION}
endif

CXXFLAGS += -I../contrib/libmodplug/src -I../contrib/libmodplug/src/include
CXXFLAGS += -I../contrib/gdm2s3m/src
LIBS += ../contrib/libmodplug/src/libmodplug.a
LIBS += ../contrib/gdm2s3m/src/libgdm2s3m.a
ifdef DEBUG
CFLAGS = -g -Wall -DDEBUG
CXXFLAGS = -g -Wall -DDEBUG
else
CFLAGS += -O2 -Wall
CXXFLAGS += -O2 -Wall
endif

.SUFFIXES: .cpp
.SUFFIXES: .cpp .c

%.o: %.cpp
${CXX} ${CXXFLAGS} ${INCLUDES} -c $<

%.o: %.c
${CC} ${CFLAGS} ${INCLUDES} -c $<
25 changes: 21 additions & 4 deletions Makefile.platform
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,31 @@
# linux makefile generics
#

all: subdir

# location of strip (must be defined)
STRIP = strip --strip-unneeded

# standard linker includes
INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL

# standard libraries
LIBS = -L${PREFIX}/lib -lSDL -lpthread
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L${PREFIX}/lib -lSDL -lpthread -lX11

# linux os specific install target
install:
mkdir -p ${PREFIX}/share/megazeux && \
chown root:root ${PREFIX}/share/megazeux && \
chmod 0755 ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_edit.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
install -o root -m 0644 config.txt /etc/megazeux-config && \
install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
ln -sf ${TARGET} ${PREFIX}/bin/megazeux

# install prefix
PREFIX=/usr
TARGET=mzx280h
6 changes: 6 additions & 0 deletions arch/Makefile.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# placebo makefile

all:
@echo "Please run config.sh before make!"
@echo "usage: ./config.sh <linux|win32|macos> <prefix>"
@echo " e.g.: ./config.sh win32 /usr"
24 changes: 20 additions & 4 deletions arch/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@
# linux makefile generics
#

all: subdir

# location of strip (must be defined)
STRIP = strip --strip-unneeded

# standard linker includes
INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL

# standard libraries
LIBS = -L${PREFIX}/lib -lSDL -lpthread
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L${PREFIX}/lib -lSDL -lpthread -lX11

# linux os specific install target
install:
mkdir -p ${PREFIX}/share/megazeux && \
chown root:root ${PREFIX}/share/megazeux && \
chmod 0755 ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_edit.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
install -o root -m 0644 config.txt /etc/megazeux-config && \
install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
ln -sf ${TARGET} ${PREFIX}/bin/megazeux
9 changes: 5 additions & 4 deletions arch/Makefile.macos
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# macos makefile generics
#

all: subdir

# location of strip (must be defined)
STRIP = strip

# standard linker includes
INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL

# standard libraries
LIBS = -L${PREFIX}/lib -lSDLmain -lSDL -lpthread -framework Cocoa
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L${PREFIX}/lib -lSDLmain -lSDL -lpthread \
-framework Cocoa
8 changes: 4 additions & 4 deletions arch/Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# win32 makefile generics
#

all: subdir

# windows requires a binary extension
BINEXT = .exe

# location of strip (must be defined)
STRIP = strip --strip-unneeded

# standard linker includes
INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL

# standard libraries
LIBS = -L${PREFIX}/lib -lmingw32 -lSDLmain -lSDL
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L/usr/lib -lmingw32 -lSDLmain -lSDL

# debug does something different
ifdef DEBUG
Expand Down
15 changes: 15 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if [ "$ARCH" = "win32" -o "$ARCH" = "macos" ]; then
echo "#define MZX_BLANK_CHR \"mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"mzx_ascii.chr\"" >> src/config.h
echo "#define MZX_EDIT_CHR \"mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"config.txt\"" >> src/config.h
Expand All @@ -46,9 +47,23 @@ if [ "$ARCH" = "linux" ]; then
echo "#define MZX_BLANK_CHR \"$PREFIX/share/megazeux/mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"$PREFIX/share/megazeux/mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"$PREFIX/share/megazeux/mzx_ascii.chr\"" >> src/config.h
echo "#define MZX_EDIT_CHR \"$PREFIX/share/megazeux/mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"$PREFIX/share/megazeux/smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"$PREFIX/share/megazeux/mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"/etc/megazeux-config\"" >> src/config.h

echo "TARGET=`grep TARGET Makefile.in | cut -d ' ' -f 6`" \
>> Makefile.platform
fi

if [ "$ARCH" != "win32" ]; then
# try to run X
X -version >/dev/null 2>&1

# X queried successfully
if [ "$?" = "0" ]; then
echo "#define CONFIG_X11" >> src/config.h
fi
fi

echo "All done!"
12 changes: 10 additions & 2 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
# Volume samples play at
#sample_volume = 8

# Volume PC speaker SFX play at
#pc_speaker_volume = 8


### Game options ###

Expand Down Expand Up @@ -199,7 +202,7 @@

# How many backups to be made. Set to zero to disable backups.

#backup_count = 0
#backup_count = 3

# How often (in seconds) backups should be made

Expand Down Expand Up @@ -252,4 +255,9 @@

#pause_on_unfocus = 0

include Cmacro.cnf
# Set to 0 if you want input boxes and strings in the robot editor
# to use the game set for characters 32-127, as opposed to the protected
# GUI set.

#mask_midchars = 1

16 changes: 0 additions & 16 deletions contrib/README.1ST

This file was deleted.

Empty file modified contrib/gdm2s3m/build.bat
100644 → 100755
Empty file.
38 changes: 15 additions & 23 deletions contrib/gdm2s3m/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
##
# gdm2s3m Makefile fragment
##
#
# src/ makefile
#

.PHONY: all clean
include ../../../Makefile.in
include ../../../Makefile.platform

.SUFFIXES: .c
# must be build with c99
CFLAGS += -std=c99

CFLAGS := -Wall -std=c99
o := o
#
# objects to build
#

gdm2s3m_base = .
gdm2s3m_cflags := -W -Wmissing-format-attribute -Wpointer-arith -Wcast-align
gdm2s3m_cflags += -Wwrite-strings -pedantic -I${gdm2s3m_base}
gdm2s3m = ${gdm2s3m_base}/libgdm2s3m.a
objs = error.o gdm.o s3m.o utility.o gdm2s3m.o

gdm2s3m_objs = \
${gdm2s3m_base}/error.${o} ${gdm2s3m_base}/gdm.${o} \
${gdm2s3m_base}/s3m.${o} ${gdm2s3m_base}/utility.${o} \
${gdm2s3m_base}/gdm2s3m.${o}
subdir: libs

${gdm2s3m_base}/%.${o}: ${gdm2s3m_base}/%.c
${CC} ${CFLAGS} ${gdm2s3m_cflags} -c $< -o $@

all: ${gdm2s3m}

${gdm2s3m}: ${gdm2s3m_objs}
ar crus ${gdm2s3m} ${gdm2s3m_objs}
libs: ${objs}
ar crus libgdm2s3m.a ${objs}

clean:
rm -f ${gdm2s3m} ${gdm2s3m_objs}
rm -f ${objs} libgdm2s3m.a
Loading

0 comments on commit 1b766c6

Please sign in to comment.