wmail: use automake.

This commit is contained in:
Jeremy Sowden 2019-06-07 09:52:23 +01:00 committed by Carlos R. Mafra
parent dc8827d41a
commit 7740071745
7 changed files with 66 additions and 79 deletions

28
wmail/.gitignore vendored
View file

@ -1,10 +1,20 @@
/aclocal.m4
/autom4te.cache/
/compile
/config.h
/config.h.in
/config.h.in~
/config.log
/config.status
/configure
/depcomp
/INSTALL
/install-sh
Makefile
autom4te.cache/
config.h
config.h.in
config.h.in~
config.log
config.status
configure
src/*.o
src/wmail
Makefile.in
/missing
/src/.deps/
/src/*.o
/src/wmail
/stamp-h1
/wmail-*.tar.gz

3
wmail/Makefile.am Normal file
View file

@ -0,0 +1,3 @@
SUBDIRS = src
EXTRA_DIST = wmailrc-sample

View file

@ -1,29 +0,0 @@
# process this file with configure to create a Makefile from it
#
# Makefile for wmail.
# Toplevel Makefile.
# Usage: make ..........: creates the wmail binary.
# make install ..: installs the binary under your default user binary
# directory.
# make uninstall : removes any installed wmail files.
# make clean ....: cleans the src directory.
@SET_MAKE@
default all target: wmail
wmail:
@cd src; $(MAKE) -f Makefile wmail
install:
@if ! test -f src/wmail; then $(MAKE) wmail; fi
@echo "Installing the binary under @bindir@."
@cp -f src/wmail @bindir@
uninstall:
@echo "Removing wmail files from your system."
@rm -f @bindir@/wmail
clean:
@echo "Cleaning src directory."
@cd src; $(MAKE) -f Makefile clean

6
wmail/autogen Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
AUTOMAKE="automake --add-missing"
export AUTOMAKE
exec autoreconf "$@"

View file

@ -1,10 +1,12 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/wmail.c)
AC_INIT([wmail], [2.0], [wmaker-dev@googlegroups.com])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR([src/wmail.c])
AM_INIT_AUTOMAKE([foreign])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl Checks for pkg-config modules.
PKG_CHECK_MODULES([X11], [x11])
@ -27,23 +29,23 @@ dnl Checks for library functions.
AC_FUNC_FNMATCH
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strdup strstr memcpy)
AC_CHECK_FUNCS([strdup strstr memcpy])
dnl Checks for libraries.
dnl Enable Debugging?
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging ],, enable_debug=no)
if test "$enable_debug" = yes; then
CPPFLAGS="$CPPFLAGS -DDEBUG -D_XOPEN_SOURCE=600"
CFLAGS="$CFLAGS -std=c99 -pedantic -Wall -Wextra -g"
fi
AC_ARG_ENABLE(debug, [ --enable-debug enable debugging ],
enable_debug=yes, enable_debug=no)
AC_MSG_CHECKING([whether to enable debugging])
AC_MSG_RESULT([$enable_debug])
AM_CONDITIONAL([ENABLE_DEBUG], [test x$enable_debug = xyes])
dnl Use delt's pixmaps instead of the default ones?
AC_ARG_ENABLE(delt_xpms,
[ --enable-delt-xpms enable delt's pixmaps ],, enable_delt_xpms=no)
if test "$enable_delt_xpms" = yes; then
CPPFLAGS="$CPPFLAGS -DUSE_DELT_XPMS"
fi
AC_ARG_ENABLE(delt_xpms, [ --enable-delt-xpms enable delt's pixmaps ],
enable_delt_xpms=yes, enable_delt_xpms=no)
AC_MSG_CHECKING([whether to enable delt's pixmaps])
AC_MSG_RESULT([$enable_delt_xpms])
AM_CONDITIONAL([ENABLE_DELT_XPMS], [test x$enable_delt_xpms = xyes])
AC_OUTPUT(Makefile src/Makefile)
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

21
wmail/src/Makefile.am Normal file
View file

@ -0,0 +1,21 @@
AM_CPPFLAGS =
AM_CFLAGS = $(dockapp_CFLAGS) $(X11_CFLAGS)
if ENABLE_DEBUG
AM_CPPFLAGS += -DDEBUG -D_XOPEN_SOURCE=600
AM_CFLAGS += -std=c99 -pedantic -Wall -Wextra
endif
if ENABLE_DELT_XPMS
AM_CPPFLAGS += -DUSE_DELT_XPMS
endif
LIBS += $(dockapp_LIBS) $(X11_LIBS)
bin_PROGRAMS = wmail
wmail_SOURCES = common.c common.h \
config.c config.h \
wmail.c \
xpm/*.xpm \
xpm_delt/*.xpm

View file

@ -1,26 +0,0 @@
# process this file with configure to create a Makefile from it
#
# Makefile for wmail.
# Makes the wmail dockapp binary and cleans the directory, respectively.
LIBS = @LIBS@ @dockapp_LIBS@ @X11_LIBS@
CC = @CC@
CFLAGS = @CFLAGS@ @dockapp_CFLAGS@ @X11_CFLAGS@
CPPFLAGS = @DEFS@ @CPPFLAGS@
default all target: wmail
wmail: wmail.o common.o config.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
wmail.o: wmail.c common.h config.h ../config.h xpm/main.xpm xpm/symbols.xpm xpm/numbers.xpm xpm/button.xpm xpm/chars.xpm
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
common.o: common.c common.h ../config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
config.o: config.c config.h common.h ../config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
clean:
rm -f wmail core *.o *~