wmcalc: Update Makefile.
In particular, - Drop INCLUDES and LIBINC variables; referenced deprecated X11R6 directories and INCLUDES unnecessarily included the default path. - Switch hard-coded gcc for CC variable. - Move hard-coded -02 and -Wall flags to new CFLAGS variable. - Switch ${} to $() for consistency. - Add new INSTALL_DIR variable for creating installation directories. - Respect CPPFLAGS and LDFLAGS.
This commit is contained in:
parent
2f0aab0f8f
commit
550de54682
|
@ -1,29 +1,32 @@
|
||||||
INCLUDES =-I/usr/X11R6/include/X11 -I/usr/local/include
|
|
||||||
LIBINC =-L/usr/X11R6/lib
|
|
||||||
LIBS = -lX11 -lXpm -lXext -lm
|
LIBS = -lX11 -lXpm -lXext -lm
|
||||||
|
CC = gcc
|
||||||
TARGET = wmcalc
|
TARGET = wmcalc
|
||||||
OBJECTS = wmcalc.o readln.o wmcalcswitch.o wmcalcfunc.o
|
OBJECTS = wmcalc.o readln.o wmcalcswitch.o wmcalcfunc.o
|
||||||
|
CFLAGS = -O2 -Wall
|
||||||
DESTDIR =
|
DESTDIR =
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
BINDIR = ${PREFIX}/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
MANDIR = ${PREFIX}/share/man/man1
|
MANDIR = $(PREFIX)/share/man/man1
|
||||||
CONF = /etc
|
CONF = /etc
|
||||||
INSTALL = /usr/bin/install
|
INSTALL = /usr/bin/install
|
||||||
|
INSTALL_DIR = $(INSTALL) -d
|
||||||
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
|
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
|
||||||
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
|
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
gcc -O2 -c -Wall ${INCLUDES} ${FLAGS} $< -o $*.o
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
|
||||||
|
|
||||||
${TARGET}: ${OBJECTS}
|
$(TARGET): $(OBJECTS)
|
||||||
gcc -O2 -o ${TARGET} ${OBJECTS} ${LIBINC} ${LIBS}
|
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done
|
for i in $(OBJECTS); do if [ -e $$i ] ; then rm $$i; fi; done
|
||||||
if [ -e ${TARGET} ] ; then rm ${TARGET}; fi
|
if [ -e $(TARGET) ] ; then rm $(TARGET); fi
|
||||||
|
|
||||||
install::
|
install::
|
||||||
${INSTALL_PROGRAM} wmcalc ${DESTDIR}${BINDIR}
|
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
|
||||||
${INSTALL_FILE} wmcalc.conf ${DESTDIR}${CONF}
|
$(INSTALL_PROGRAM) wmcalc $(DESTDIR)$(BINDIR)
|
||||||
${INSTALL_FILE} wmcalc.1 ${DESTDIR}${MANDIR}
|
$(INSTALL_DIR) $(DESTDIR)$(CONF)
|
||||||
|
$(INSTALL_FILE) wmcalc.conf $(DESTDIR)$(CONF)
|
||||||
|
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1
|
||||||
|
$(INSTALL_FILE) wmcalc.1 $(DESTDIR)$(MANDIR)
|
||||||
|
|
Loading…
Reference in a new issue