wmmoonclock: Use autotools for build.

This commit is contained in:
Doug Torrance 2017-08-14 18:49:23 -04:00 committed by Carlos R. Mafra
parent 3cbdd1664a
commit 509deea873
4 changed files with 22 additions and 43 deletions

12
wmmoonclock/Makefile.am Normal file
View file

@ -0,0 +1,12 @@
bin_PROGRAMS = wmmoonclock
dist_man_MANS = src/wmMoonClock.1
wmmoonclock_SOURCES = src/CalcEphem.c src/CalcEphem.h src/Moon.c src/Moon.h \
src/MoonRise.c src/MoonRise.h src/wmMoonClock.c \
src/wmMoonClock_mask.xbm \
src/wmMoonClock_masterLow.xpm \
src/wmMoonClock_master.xpm \
src/xutils.c src/xutils.h
EXTRA_DIST = BUGS
AM_CFLAGS = $(x11_CFLAGS) $(xext_CFLAGS) $(xpm_CFLAGS)
LIBS += $(x11_LIBS) $(xext_LIBS) $(xpm_LIBS) -lm

9
wmmoonclock/configure.ac Normal file
View file

@ -0,0 +1,9 @@
AC_INIT([wmmoonclock], [1.28], [wmaker-dev@lists.windowmaker.org])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([configure.ac])
AC_PROG_CC
PKG_CHECK_MODULES([x11], [x11])
PKG_CHECK_MODULES([xext], [xext])
PKG_CHECK_MODULES([xpm], [xpm])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View file

@ -1,37 +0,0 @@
CC = gcc
# CFLAGS = -O2
INCDIR = -I/usr/X11R6/include/X11
DESTDIR= /usr/X11R6
LIBDIR = -L/usr/X11R6/lib
# for Linux
LIBS = -lXpm -lX11 -lXext -lm
# for Solaris
# LIBS = -lXpm -lX11 -lXext -lm -lsocket
OBJS = wmMoonClock.o CalcEphem.o Moon.o MoonRise.o \
xutils.o
.c.o:
$(CC) $(CFLAGS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
all: wmMoonClock.o wmMoonClock
wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h
wmMoonClock: $(OBJS)
$(CC) $(CFLAGS) $(SYSTEM) -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
clean:
for i in $(OBJS) ; do \
rm -f $$i; \
done
rm -f wmMoonClock
install:: wmMoonClock
install -d -m 0755 $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1
install -m 0755 wmMoonClock $(DESTDIR)/usr/bin
install -m 0644 wmMoonClock.1 $(DESTDIR)/usr/share/man/man1

View file

@ -124,11 +124,6 @@
* Delay between refreshes (in microseconds)
*/
#define DELAY 1000000L
#define WMMOONCLOCK_VERSION "1.27"
void ParseCMDLine(int argc, char *argv[]);
void pressEvent(XButtonEvent *xev);
@ -847,7 +842,7 @@ void ParseCMDLine(int argc, char *argv[]) {
void print_usage(){
printf("\nwmMoonClock version: %s\n", WMMOONCLOCK_VERSION);
printf("\nwmMoonClock version: %s\n", PACKAGE_VERSION);
printf("\nusage: wmMoonClock [-display <Display>] [-lat <Latitude>] [-lon <Longitude>] [-h]\n");
printf(" [-bc <Color>] [-lc <Color>] [-dc <Color>]\n\n");
printf("\t-display <Display>\tUse alternate X display.\n");