2011-01-17 13:57:59 +00:00
|
|
|
all: sxiv
|
|
|
|
|
2011-05-10 07:47:24 +00:00
|
|
|
VERSION=git-20110510
|
2011-01-23 16:27:44 +00:00
|
|
|
|
2011-01-17 13:57:59 +00:00
|
|
|
CC?=gcc
|
2011-05-10 07:31:43 +00:00
|
|
|
DESTDIR?=
|
2011-01-17 13:57:59 +00:00
|
|
|
PREFIX?=/usr/local
|
2011-02-21 15:49:34 +00:00
|
|
|
CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\"
|
2011-01-17 13:57:59 +00:00
|
|
|
LDFLAGS+=
|
2011-02-17 10:04:58 +00:00
|
|
|
LIBS+= -lX11 -lImlib2
|
2011-01-17 13:57:59 +00:00
|
|
|
|
|
|
|
SRCFILES=$(wildcard *.c)
|
|
|
|
OBJFILES=$(SRCFILES:.c=.o)
|
|
|
|
|
2011-01-17 15:18:47 +00:00
|
|
|
sxiv: $(OBJFILES)
|
2011-01-17 13:57:59 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
|
2011-01-20 14:37:06 +00:00
|
|
|
%.o: %.c Makefile config.h
|
2011-01-17 13:57:59 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
install: all
|
2011-05-10 07:47:24 +00:00
|
|
|
install -D -m 755 -o root -g root sxiv $(DESTDIR)$(PREFIX)/bin/sxiv
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
|
|
|
|
sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(PREFIX)/share/man/man1/sxiv.1
|
|
|
|
chmod 644 $(DESTDIR)$(PREFIX)/share/man/man1/sxiv.1
|
2011-01-17 13:57:59 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f sxiv *.o
|
|
|
|
|
|
|
|
tags: *.h *.c
|
|
|
|
ctags $^
|
|
|
|
|
|
|
|
cscope: *.h *.c
|
|
|
|
cscope -b
|