From 4db8f00e9757278c05f983a963eef5c1727c8e74 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 11 Jul 2018 22:12:42 -0400 Subject: [PATCH] wmmisc: Switch to autotools for build. --- wmmisc/Makefile | 8 ----- wmmisc/Makefile.am | 9 ++++++ wmmisc/configure.ac | 12 ++++++++ wmmisc/src/Makefile | 51 ------------------------------- wmmisc/src/general.mk | 70 ------------------------------------------- 5 files changed, 21 insertions(+), 129 deletions(-) delete mode 100644 wmmisc/Makefile create mode 100644 wmmisc/Makefile.am create mode 100644 wmmisc/configure.ac delete mode 100644 wmmisc/src/Makefile delete mode 100644 wmmisc/src/general.mk diff --git a/wmmisc/Makefile b/wmmisc/Makefile deleted file mode 100644 index 6d4cc7d..0000000 --- a/wmmisc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - make -C src all - -install: - make -C src install - -clean: - make -C src clean diff --git a/wmmisc/Makefile.am b/wmmisc/Makefile.am new file mode 100644 index 0000000..dd9c272 --- /dev/null +++ b/wmmisc/Makefile.am @@ -0,0 +1,9 @@ +bin_PROGRAMS = wmmisc +wmmisc_SOURCES = src/dockapp_draw.c src/dockapp_draw.h \ + src/dockapp_main.c src/dockapp_main.h \ + src/dockapp_utils.c src/dockapp_utils.h \ + src/wmgeneral.c src/wmgeneral.h \ + src/wmmisc-master.xpm + +AM_CFLAGS = $(X11_CFLAGS) $(XEXT_CFLAGS) $(XPM_CFLAGS) +LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XPM_LIBS) diff --git a/wmmisc/configure.ac b/wmmisc/configure.ac new file mode 100644 index 0000000..1a866f9 --- /dev/null +++ b/wmmisc/configure.ac @@ -0,0 +1,12 @@ +AC_INIT([wmmisc], [1.1], [wmaker-dev@googlegroups.com]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) +AC_CONFIG_SRCDIR([configure.ac]) +AC_PROG_CC +AC_SEARCH_LIBS([nearbyintf], [m], [], [ + AC_MSG_ERROR([unable to find the nearbyintf() function]) +]) +PKG_CHECK_MODULES([X11], [x11]) +PKG_CHECK_MODULES([XEXT], [xext]) +PKG_CHECK_MODULES([XPM], [xpm]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/wmmisc/src/Makefile b/wmmisc/src/Makefile deleted file mode 100644 index 2cf480a..0000000 --- a/wmmisc/src/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -include general.mk - -#CPPFLAGS += -DUSE_MTRACE - -objects = wmgeneral.o \ - dockapp_draw.o \ - dockapp_utils.o \ - dockapp_main.o - -headers = wmgeneral.h \ - dockapp_draw.h \ - dockapp_utils.h \ - dockapp_main.h - -sources = wmgeneral.c \ - dockapp_draw.c \ - dockapp_utils.c \ - dockapp_main.c - -package = wmmisc - -all: $(package) - -$(package): $(objects) - rm -f $(package) - $(CC) $(CFLAGS) -o $(package) $(objects) $(LDFLAGS) - -wmgeneral.o: wmgeneral.c wmgeneral.h - rm -f wmgeneral.o - $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c -o wmgeneral.o wmgeneral.c - -dockapp_draw.o: dockapp_draw.c wmgeneral.h dockapp_draw.h - rm -f dockapp_draw.o - $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c -o dockapp_draw.o dockapp_draw.c - -dockapp_utils.o: dockapp_utils.c wmgeneral.h dockapp_draw.h dockapp_utils.h - rm -f dockapp_utils.o - $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c -o dockapp_utils.o dockapp_utils.c - -dockapp_main.o: dockapp_main.c wmgeneral.h dockapp_draw.h dockapp_utils.h dockapp_main.h - rm -f dockapp_main.o - $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c -o dockapp_main.o dockapp_main.c - -install: - install -c -s -o root -g root -m 755 $(package) $(BINDIR) - -uninstall: - rm -f $(BINDIR)/$(package) - -clean: - rm -f $(package) $(objects) *~ core core.* gmon.out diff --git a/wmmisc/src/general.mk b/wmmisc/src/general.mk deleted file mode 100644 index 4f41d8b..0000000 --- a/wmmisc/src/general.mk +++ /dev/null @@ -1,70 +0,0 @@ -######################################################### -# This is included in a Makefile. -# -# e.g.: -# include general.mk -######################################################### - -ifeq ($(MODULAR_X),1) -PREFIX = $(shell pkg-config --variable=prefix xorg-server) -else -PREFIX = /usr/X11R6 -endif -BINDIR = $(PREFIX)/bin -LIBDIR = $(PREFIX)/lib -INCDIR = $(PREFIX)/include -MANDIR = $(PREFIX)/share/man -# Set some destination locations. - -CC = gcc -CXX = g++ -# Set the compilers. - -#CFLAGS = -O2 -#CXXFLAGS = $(CFLAGS) -# Safe for all systems. - -ifeq ($(CFLAGS),) - CFLAGS = -march=pentium3 -O2 -fomit-frame-pointer -pipe - CXXFLAGS = $(CFLAGS) -endif -# This is what I use on my box (Intel Celeron (Coppermine) 800MHz). - -ifeq ($(FASTER_MATH),1) - CFLAGS += -mfpmath=sse -ffast-math -endif - -CFLAGS += -std=c99 -CFLAGS += -Wall -W -CXXFLAGS += -std=c99 -CXXFLAGS += -Wall -W -# Set the compiler flags. - -AS = as -ASFLAGS = -# Set the assembler and flags. - -LD = ld -LDFLAGS = -lm -ifeq ($(MODULAR_X),1) -LDFLAGS += $(shell pkg-config --libs x11 xpm xext) -else -LDFLAGS += -L/usr/X11R6/lib -lX11 -lXpm -lXext -endif -LDFLAGS += -Wl,-O1 -# Set the linker and flags. - -AR = ar -ARFLAGS = cruv -RANLIB = ranlib - -CPPFLAGS = -D_GNU_SOURCE -# Set the preprocessor flags. - -ifeq ($(MODULAR_X),1) -INCLUDES = $(shell pkg-config --cflags x11 xpm xext) -else -INCLUDES = -I/usr/X11R6/include -endif -INCLUDES += -I. -# Set the include locations.