diff --git a/.gitignore b/.gitignore index f1af8aa..9dd73a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,14 @@ # Ignore Builds build/ + +# Ignore autoconf cruft for now +Makefile.in +aclocal.m4 +autom4te.cache/ +autoscan.log +compile +config.h.in +configure +depcomp +install-sh +missing diff --git a/Makefile b/Makefile deleted file mode 100644 index 818a90d..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Set default options -CC = clang++ - -CFLAGS = -g -Wall -lSDL2 -lSDL2main -lGLEW -lGL - -TARGET = Game -SRCDIR = src/ -BUILDDIR = build/ - -all: $(TARGET) - -$(TARGET): $(SRCDIR)main.cpp $(BUILDDIR) - $(CC) $(CFLAGS) -o $(BUILDDIR)$(TARGET) $(SRCDIR)main.cpp - -$(BUILDDIR): - mkdir -p $(BUILDDIR) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..1f8bbec --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ +AUTOMAKE_OPTIONS = subdir-objects + +bin_PROGRAMS = Game + +Game_SOURCES = \ + src/main.cpp +Game_CPPFLAGS = @sdl2_CFLAGS@ @glew_CFLAGS@ @opengl_CFLAGS@ +Game_LDFLAGS = @sdl2_LIBS@ @glew_LIBS@ @opengl_LIBS@ diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c000e02 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([Game], [0.0.1], [wytau@sdf.org]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Checks for programs. +AC_PROG_CXX + +# Checks for libraries. +PKG_CHECK_MODULES([sdl2], sdl2, [], AC_MSG_ERROR([Failed to find sdl2])) +PKG_CHECK_MODULES([glew], glew, [], AC_MSG_ERROR([Failed to find glew])) +PKG_CHECK_MODULES([opengl], gl, [], AC_MSG_ERROR([Failed to find OpenGL])) + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT