Skip to content

Commit

Permalink
Merge pull request fabiensanglard#32 from darealshinji/automake-2
Browse files Browse the repository at this point in the history
Use GNU automake build system
  • Loading branch information
fabiensanglard committed Sep 2, 2015
2 parents f0ad54a + d793e0a commit dd8db65
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 73 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,21 @@ DUKE3D.GRP
# Linux
*.o
*.a
*~
chocolate-duke3d
duke3d.cfg
duke3d.grp

# GNU automake
.deps
/aclocal.m4
/autom4te.cache
/build-aux
Makefile
Makefile.in
/config.h
/config.h.in
/config.log
/config.status
/configure
/stamp-h1
10 changes: 0 additions & 10 deletions Engine/src/Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions Engine/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
noinst_LIBRARIES = libEngine.a
libEngine_a_SOURCES = cache.c display.c draw.c dummy_multi.c engine.c filesystem.c fixedPoint_math.c mmulti.c network.c tiles.c
libEngine_a_CFLAGS = -I$(top_srcdir)/Game/src
6 changes: 3 additions & 3 deletions Engine/src/mmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include "mmulti_unstable.h"

#if defined(__APPLE__)
#include "enet/include/enet.h"
#if (HAVE_ENET_ENET_H == 1)
#include <enet/enet.h>
#else
#include <enet.h>
#include "enet/include/enet.h"
#endif

//STL
Expand Down
2 changes: 1 addition & 1 deletion Game/Game.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="chocolateDukeRessources.rc" />
<ResourceCompile Include="chocolateDukeResources.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
2 changes: 1 addition & 1 deletion Game/Game.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="chocolateDukeRessources.rc" />
<ResourceCompile Include="chocolateDukeResources.rc" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Game/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if WITH_WIN_ICON
chocolateDukeResources.o: chocolateDukeResources.rc
@WINDRES@ $^ -o $@
endif
File renamed without changes.
17 changes: 0 additions & 17 deletions Game/src/Makefile

This file was deleted.

14 changes: 14 additions & 0 deletions Game/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SUBDIRS = audiolib midi

noinst_LIBRARIES = libGame.a

libGame_a_SOURCES = \
actors.c animlib.c config.c console.c control.c cvar_defs.c cvars.c dummy_audiolib.c game.c \
gamedef.c global.c keyboard.c menues.c player.c rts.c scriplib.c sector.c sounds.c
libGame_a_LIBADD = premap.o
libGame_a_CFLAGS = -I$(top_srcdir)/Engine/src

# Starting a new game will lead to a crash if premap.o was built with -O1/-O2/-O3,
# that's why we're compiling it seperately with -O0
premap.o: premap.c
$(AM_V_CC)$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I$(top_srcdir)/Engine/src -O0 -c $^ -o $@
22 changes: 0 additions & 22 deletions Game/src/audiolib/Makefile

This file was deleted.

4 changes: 4 additions & 0 deletions Game/src/audiolib/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
noinst_LIBRARIES = libaudio.a
libaudio_a_SOURCES = fx_man.c dsl.c ll_man.c multivoc.c mv_mix.c mvreverb.c nodpmi.c pitch.c user.c usrhooks.c

AM_CFLAGS = -I$(top_srcdir)/Engine/src
4 changes: 4 additions & 0 deletions Game/src/audiolib/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if (HAVE_ASSERT_H != 1)

#ifndef __ASSERT_H

#define __ASSERT_H
Expand All @@ -43,3 +45,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#error Multiple definition of ASSERT()

#endif

#endif //HAVE_ASSERT_H
10 changes: 0 additions & 10 deletions Game/src/midi/Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions Game/src/midi/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
noinst_LIBRARIES = libmidi.a
libmidi_a_SOURCES = sdl_midi.c
libmidi_a_CFLAGS = -I$(top_srcdir)/Engine/src
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SUBDIRS = Game/src Engine/src Game

bin_PROGRAMS = chocolate-duke3d
chocolate_duke3d_SOURCES =
chocolate_duke3d_LDADD = \
Game/src/libGame.a \
Game/src/audiolib/libaudio.a \
Game/src/midi/libmidi.a \
Engine/src/libEngine.a \
$(SDL_LIBS) $(SDL_MIXER_LIBS)
if WITH_WIN_ICON
chocolate_duke3d_LDADD += Game/chocolateDukeResources.o
endif

doc_DATA = README.md

pixmapdir = $(datadir)/pixmaps
pixmap_DATA = Game/duke_icon.png
4 changes: 4 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
rm -rf autom4te.cache build-aux aclocal.m4
autoreconf -ivf
rm -rf autom4te.cache
46 changes: 46 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT([Chocolate Duke3D],
[1.0],
[https://github.com/fabiensanglard/chocolate_duke3D/issues])
AC_CONFIG_SRCDIR([.])

AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
AM_SILENT_RULES([yes])

# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
case "$host" in
*cygwin*|*mingw*)
AC_CHECK_TOOL([WINDRES], [windres], [])
;;
esac
AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""])

# Checks for libraries.
PKG_CHECK_MODULES([SDL], [sdl], [], [
AC_CHECK_LIB([SDL], [main], [], [exit 1])
])
PKG_CHECK_MODULES([SDL_MIXER], [SDL_mixer], [], [
AC_CHECK_LIB([SDL_mixer], [main], [], [exit 1])
])

dnl Compiler flags
CFLAGS_WARNINGS="-Wall -Wno-pointer-sign -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast \
-Wno-parentheses -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-result"
CFLAGS="${CFLAGS_WARNINGS} -fno-strict-aliasing -fno-aggressive-loop-optimizations -DPLATFORM_UNIX $(pkg-config --cflags SDL_mixer) ${CFLAGS}"
LDFLAGS="$(pkg-config --libs sdl) $(pkg-config --libs SDL_mixer) ${LDFLAGS}"

# Checks for header files.
AC_CHECK_HEADERS([assert.h enet/enet.h])

AC_CONFIG_FILES([Engine/src/Makefile
Game/src/Makefile
Game/src/audiolib/Makefile
Game/src/midi/Makefile
Game/Makefile
Makefile])
AC_OUTPUT

0 comments on commit dd8db65

Please sign in to comment.