wmcalc: Use autotools for build.

This commit is contained in:
Doug Torrance 2018-09-10 19:53:28 -04:00 committed by Carlos R. Mafra
parent ec62fab633
commit 13b3710b02
4 changed files with 21 additions and 32 deletions

View file

@ -1,32 +0,0 @@
LIBS = -lX11 -lXpm -lXext -lm
CC = gcc
TARGET = wmcalc
OBJECTS = wmcalc.o readln.o wmcalcswitch.o wmcalcfunc.o
CFLAGS = -O2 -Wall
DESTDIR =
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
CONF = /etc
INSTALL = /usr/bin/install
INSTALL_DIR = $(INSTALL) -d
INSTALL_PROGRAM = $(INSTALL)
INSTALL_FILE = $(INSTALL) -m 644
.c.o:
$(CC) -DCONF=\"$(CONF)\" $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
clean::
for i in $(OBJECTS); do if [ -e $$i ] ; then rm $$i; fi; done
if [ -e $(TARGET) ] ; then rm $(TARGET); fi
install::
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) wmcalc $(DESTDIR)$(BINDIR)
$(INSTALL_DIR) $(DESTDIR)$(CONF)
$(INSTALL_FILE) wmcalc.conf $(DESTDIR)$(CONF)
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
$(INSTALL_FILE) wmcalc.1 $(DESTDIR)$(MANDIR)

10
wmcalc/Makefile.am Normal file
View file

@ -0,0 +1,10 @@
bin_PROGRAMS = wmcalc
wmcalc_SOURCES = readln.c wmcalc.c wmcalcfunc.c wmcalcswitch.c \
wmcalc_c.h wmcalc_err.h wmcalc_f.h wmcalc_g.h wmcalc_t.h wmcalc_x.h \
backdrop.xpm calcbuttons.xpm charmap.xpm mask.xbm
dist_man_MANS = wmcalc.1
dist_sysconf_DATA = wmcalc.conf
AM_CPPFLAGS = -DCONF=\"@sysconfdir@\"
AM_CFLAGS = $(X11_CFLAGS) $(XEXT_CFLAGS) $(XPM_CFLAGS)
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XPM_LIBS)

View file

@ -37,6 +37,7 @@ bugs in the code, etc.
INSTALLATION:
-------------
Compile it:
./configure
make clean; make
As root, install it:

10
wmcalc/configure.ac Normal file
View file

@ -0,0 +1,10 @@
AC_INIT([wmcalc], [0.6], [wmaker-dev@googlegroups.com])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([configure.ac])
AC_PROG_CC
PKG_CHECK_MODULES([X11], [x11])
PKG_CHECK_MODULES([XEXT], [xext])
PKG_CHECK_MODULES([XPM], [xpm])
AC_SEARCH_LIBS([pow], [m])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT