From 155983d543d024ed953d0d8301ddbca1d20c3142 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 15 Feb 2013 17:18:50 -0500 Subject: Use GNU Autoconf and Automake. --- diff --git a/.gitignore b/.gitignore index 9fdb10a..664bac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,13 @@ +aclocal.m4 +autom4te.cache/ +configure +compile +install-sh +missing +INSTALL +depcomp +Makefile.in + *.o sdlex a.out diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/AUTHORS diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/COPYING diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog diff --git a/Makefile b/Makefile deleted file mode 100644 index 2648c43..0000000 --- a/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -.SUFFIXES = -.SUFFIXES = .c .h .o - -CC = gcc -CFLAGS = -Wall -Wextra -Werror -g - -SRCS = src/main.c src/init.c src/logging.c \ - src/base64.c src/compression.c \ - src/tmx.c src/resources/resource.c src/resources/image.c -OBJS = $(SRCS:.c=.o) -LIBS = sdl SDL_image zlib expat - -all: sdlex - -sdlex: $(OBJS) - $(CC) $(LDFLAGS) -o sdlex $$(pkg-config --libs $(LIBS)) $(OBJS) - -.c.o: - $(CC) -c $(CFLAGS) -o $*.o $$(pkg-config --cflags $(LIBS)) $< - -clean: - rm -f $(OBJS) sdlex diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..b7a392e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,17 @@ +bin_PROGRAMS = sdlex + +sdlex_SOURCES = src/main.c src/init.c src/logging.c \ + src/base64.c src/compression.c \ + src/tmx.c src/resources/resource.c src/resources/image.c + +sdlex_CFLAGS = $(GCC_CFLAGS) \ + $(SDL_CFLAGS) \ + $(SDL_IMAGE_CFLAGS) \ + $(ZLIB_CFLAGS) \ + $(EXPAT_CFLAGS) + +sdlex_LDADD = $(SDL_LIBS) \ + $(SDL_IMAGE_LIBS) \ + $(ZLIB_LIBS) \ + $(EXPAT_LIBS) + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/NEWS diff --git a/README b/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..4cc7b38 --- /dev/null +++ b/configure.ac @@ -0,0 +1,33 @@ +AC_INIT([sdlex], [0.1.0], [pjm@nac.net]) +AC_CONFIG_SRCDIR([src/main.c]) + +AM_INIT_AUTOMAKE([subdir-objects]) + +AC_PROG_CC() +AM_PROG_CC_C_O() + +AC_C_INLINE() + +AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADERS([string.h]) + +AC_TYPE_SIZE_T() + +AC_FUNC_MALLOC() +AC_CHECK_FUNCS([memset]) +AC_CHECK_FUNCS([strdup]) +AC_CHECK_FUNCS([strndup]) + +PKG_PROG_PKG_CONFIG() +PKG_CHECK_MODULES([SDL], [sdl]) +PKG_CHECK_MODULES([SDL_IMAGE], [SDL_image]) +PKG_CHECK_MODULES([ZLIB], [zlib]) +PKG_CHECK_MODULES([EXPAT], [expat]) + +if test "x$GCC" = "xyes"; then + GCC_CFLAGS="-Wall -Wextra -Werror -pedantic" +fi +AC_SUBST(GCC_CFLAGS) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT() -- cgit v0.9.1