[PATCH 06/10] wmgtemp: Switch to autotools for build.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
---
 wmgtemp/Makefile      | 17 -----------------
 wmgtemp/Makefile.am   |  9 +++++++++
 wmgtemp/configure.ac  |  9 +++++++++
 wmgtemp/src/.deps     |  1 -
 wmgtemp/src/Makefile  | 29 -----------------------------
 wmgtemp/src/wmgtemp.c |  2 +-
 6 files changed, 19 insertions(+), 48 deletions(-)
 delete mode 100644 wmgtemp/Makefile
 create mode 100644 wmgtemp/Makefile.am
 create mode 100644 wmgtemp/configure.ac
 delete mode 100755 wmgtemp/src/.deps
 delete mode 100644 wmgtemp/src/Makefile

diff --git a/wmgtemp/Makefile b/wmgtemp/Makefile
deleted file mode 100644
index 1d5e696..0000000
--- a/wmgtemp/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-INSTALL=install
-MANINSTDIR=/usr/local/man/man1
-MANPAGE=wmgtemp.1
-
-all:    
-	( cd src && $(MAKE) )
-
-depend:    
-	( cd src && $(MAKE) depend )
-
-install:    
-	( cd src && $(MAKE) install INSTDIR=$(INSTDIR) )
-	$(INSTALL) -d $(MANINSTDIR)
-	$(INSTALL) -m 755 -c $(MANPAGE) $(MANINSTDIR)/$(MANPAGE)
-
-clean:
-	( cd src && $(MAKE) clean)
diff --git a/wmgtemp/Makefile.am b/wmgtemp/Makefile.am
new file mode 100644
index 0000000..a41b44d
--- /dev/null
+++ b/wmgtemp/Makefile.am
@@ -0,0 +1,9 @@
+bin_PROGRAMS = wmgtemp
+wmgtemp_SOURCES = src/wmgtemp.c src/wmgtemp-interface-mask.xbm \
+	src/wmgtemp-interface.xpm
+dist_man_MANS = wmgtemp.1
+
+AM_CFLAGS = $(X11_CFLAGS) $(dockapp_CFLAGS)
+LIBS += $(X11_LIBS) $(dockapp_LIBS)
+
+EXTRA_DIST = Artistic BUGS CREDITS examples/wmgtemprc
diff --git a/wmgtemp/configure.ac b/wmgtemp/configure.ac
new file mode 100644
index 0000000..c2d39e7
--- /dev/null
+++ b/wmgtemp/configure.ac
@@ -0,0 +1,9 @@
+AC_INIT([wmgtemp], [1.1], [[email protected]])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
+AC_CONFIG_SRCDIR([configure.ac])
+AC_PROG_CC
+AC_CHECK_LIB([sensors],[sensors_get_features])
+PKG_CHECK_MODULES([X11],[x11])
+PKG_CHECK_MODULES([dockapp],[dockapp])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/wmgtemp/src/.deps b/wmgtemp/src/.deps
deleted file mode 100755
index 6a2ab43..0000000
--- a/wmgtemp/src/.deps
+++ /dev/null
@@ -1 +0,0 @@
-wmgtemp.o: wmgtemp.c wmgtemp-interface.xpm wmgtemp-interface-mask.xbm
diff --git a/wmgtemp/src/Makefile b/wmgtemp/src/Makefile
deleted file mode 100644
index e1c5ff4..0000000
--- a/wmgtemp/src/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-CC      = gcc
-INSTALL = /usr/bin/install
-LIB     = lib
-LDFLAGS = -L/usr/X11R6/$(LIB) -lXpm -lXext -lX11 -lsensors -ldockapp
-BINARY  = wmgtemp
-CCFLAGS = -Wall -g
-INSTDIR = /usr/local/bin
-
-OFILES  = wmgtemp.o
-
-%.o:
-	$(CC) $(CCFLAGS) -c $*.c -o $*.o
-
-$(BINARY): $(OFILES)
-	$(CC) $(OFILES) $(LDFLAGS) -o $(BINARY)
-
-clean:
-	@ $(RM) $(OFILES) *~ "#"* $(BINARY)
-
-install::
-	$(INSTALL) -m 755 -c $(BINARY) $(INSTDIR)/$(BINARY)
-
-depend:
-	@ $(CC) -MM *.c > .deps
-
-count:
-	@ wc -l *.c *.h | sort
-
-include .deps
diff --git a/wmgtemp/src/wmgtemp.c b/wmgtemp/src/wmgtemp.c
index 12771e9..c47ee33 100644
--- a/wmgtemp/src/wmgtemp.c
+++ b/wmgtemp/src/wmgtemp.c
@@ -688,7 +688,7 @@ int init_sensors() {
 }
 
 void display_usage() {
-  printf("wmgtemp v0.9\n" \
+  printf("wmgtemp v"PACKAGE_VERSION"\n" \
 	 "Usage: wmgtemp [options]\n" \
 	 "Options:\n" \
 	 "   -S, --sensorconf=PATH  Specify sensors config file PATH\n" \
-- 
2.7.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.