2015-01-10 16:59:41 +00:00
|
|
|
LIBS = -lX11 -lXpm -lXext -lm
|
2015-01-10 16:59:43 +00:00
|
|
|
CC = gcc
|
2015-01-10 16:59:41 +00:00
|
|
|
TARGET = wmcalc
|
|
|
|
OBJECTS = wmcalc.o readln.o wmcalcswitch.o wmcalcfunc.o
|
2015-01-10 16:59:43 +00:00
|
|
|
CFLAGS = -O2 -Wall
|
2015-01-10 16:59:41 +00:00
|
|
|
DESTDIR =
|
|
|
|
PREFIX = /usr/local
|
2015-01-10 16:59:43 +00:00
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
MANDIR = $(PREFIX)/share/man/man1
|
2015-01-10 16:59:41 +00:00
|
|
|
CONF = /etc
|
|
|
|
INSTALL = /usr/bin/install
|
2015-01-10 16:59:43 +00:00
|
|
|
INSTALL_DIR = $(INSTALL) -d
|
2015-01-10 16:59:52 +00:00
|
|
|
INSTALL_PROGRAM = $(INSTALL)
|
|
|
|
INSTALL_FILE = $(INSTALL) -m 644
|
2015-01-10 16:59:41 +00:00
|
|
|
|
|
|
|
.c.o:
|
2015-01-10 16:59:52 +00:00
|
|
|
$(CC) -DCONF=\"$(CONF)\" $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
|
2015-01-10 16:59:41 +00:00
|
|
|
|
2015-01-10 16:59:43 +00:00
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
2015-01-10 16:59:41 +00:00
|
|
|
|
|
|
|
clean::
|
2015-01-10 16:59:43 +00:00
|
|
|
for i in $(OBJECTS); do if [ -e $$i ] ; then rm $$i; fi; done
|
|
|
|
if [ -e $(TARGET) ] ; then rm $(TARGET); fi
|
2015-01-10 16:59:41 +00:00
|
|
|
|
|
|
|
install::
|
2015-01-10 16:59:43 +00:00
|
|
|
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL_PROGRAM) wmcalc $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL_DIR) $(DESTDIR)$(CONF)
|
|
|
|
$(INSTALL_FILE) wmcalc.conf $(DESTDIR)$(CONF)
|
2015-08-23 06:20:07 +00:00
|
|
|
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
|
2015-01-10 16:59:43 +00:00
|
|
|
$(INSTALL_FILE) wmcalc.1 $(DESTDIR)$(MANDIR)
|