wmifinfo: Update Makefile.
In particular, add support for common user-defined variables CFLAGS, CPPFLAGS, LDFLAGS, DESTDIR, and PREFIX. Also remove reference to deprecated X11R6 directory and use install instead of cp for install target. Inspired by the Debian patches: http://sources.debian.net/src/wmifinfo/0.09-7/debian/patches/makefile_add_ldflags.patch/ http://sources.debian.net/src/wmifinfo/0.09-7/debian/patches/makefile_patch.patch/
This commit is contained in:
parent
ad6d781c1a
commit
6905ad773e
|
@ -13,9 +13,12 @@ VERSION=0.09
|
|||
|
||||
CC = gcc
|
||||
LD = gcc
|
||||
COPTS = -Wall -O2 -D'VERSION="$(VERSION)"' -D'NAME="$(NAME)"'
|
||||
LDOPTS = -lX11 -L/usr/X11R6/lib -lXpm -lXext
|
||||
BINDIR = /usr/local/bin
|
||||
INSTALL = install
|
||||
CFLAGS = -Wall -O2
|
||||
COPTS = -D'VERSION="$(VERSION)"' -D'NAME="$(NAME)"'
|
||||
LDOPTS = -lX11 -lXpm -lXext
|
||||
PREFIX = /usr/local
|
||||
BINDIR = $(PREFIX)/bin
|
||||
|
||||
BIN = wmifinfo
|
||||
FILES = wmifinfo.o xutils.o
|
||||
|
@ -28,16 +31,17 @@ endif
|
|||
all: $(BIN)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(COPTS) -c $<
|
||||
$(CC) $(COPTS) $(CPPFLAGS) $(CFLAGS) -c $<
|
||||
|
||||
$(BIN): $(FILES)
|
||||
$(LD) -o $@ $(FILES) $(LDOPTS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(FILES) $(LDOPTS)
|
||||
|
||||
clean:
|
||||
rm -f *.o $(BIN) core ./.#* *.orig *.rej
|
||||
|
||||
install:
|
||||
cp $(BIN) $(BINDIR)
|
||||
$(INSTALL) -d $(DESTDIR)$(BINDIR)
|
||||
$(INSTALL) $(BIN) $(DESTDIR)$(BINDIR)
|
||||
|
||||
dist: clean
|
||||
rm -rf /tmp/wmifinfo-$(VERSION)
|
||||
|
|
Loading…
Reference in a new issue