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:41 +00:00
|
|
|
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
|
|
|
|
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
|
|
|
|
|
|
|
|
.c.o:
|
2015-01-10 16:59:43 +00:00
|
|
|
$(CC) $(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)
|
|
|
|
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1
|
|
|
|
$(INSTALL_FILE) wmcalc.1 $(DESTDIR)$(MANDIR)
|