From 13b3710b0258679d6b6c1785fe326e9270b74c16 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 10 Sep 2018 19:53:28 -0400 Subject: [PATCH] wmcalc: Use autotools for build. --- wmcalc/Makefile | 32 -------------------------------- wmcalc/Makefile.am | 10 ++++++++++ wmcalc/README | 1 + wmcalc/configure.ac | 10 ++++++++++ 4 files changed, 21 insertions(+), 32 deletions(-) delete mode 100644 wmcalc/Makefile create mode 100644 wmcalc/Makefile.am create mode 100644 wmcalc/configure.ac diff --git a/wmcalc/Makefile b/wmcalc/Makefile deleted file mode 100644 index 90a0fd7..0000000 --- a/wmcalc/Makefile +++ /dev/null @@ -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) diff --git a/wmcalc/Makefile.am b/wmcalc/Makefile.am new file mode 100644 index 0000000..4f57f00 --- /dev/null +++ b/wmcalc/Makefile.am @@ -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) diff --git a/wmcalc/README b/wmcalc/README index bff3a95..b44fea4 100644 --- a/wmcalc/README +++ b/wmcalc/README @@ -37,6 +37,7 @@ bugs in the code, etc. INSTALLATION: ------------- Compile it: + ./configure make clean; make As root, install it: diff --git a/wmcalc/configure.ac b/wmcalc/configure.ac new file mode 100644 index 0000000..072b8e9 --- /dev/null +++ b/wmcalc/configure.ac @@ -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