aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0afa90141b69fd8117bd52bae3a24148063bd8ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
all: sxiv

VERSION=git-20110310

CC?=gcc
PREFIX?=/usr/local
CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\"
LDFLAGS+= 
LIBS+= -lX11 -lImlib2

SRCFILES=$(wildcard *.c)
OBJFILES=$(SRCFILES:.c=.o)

sxiv:	$(OBJFILES)
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

%.o: %.c Makefile config.h
	$(CC) $(CFLAGS) -c -o $@ $<

install: all
	install -D -m 755 -o root -g root sxiv $(PREFIX)/bin/sxiv
	mkdir -p $(PREFIX)/share/man/man1
	sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(PREFIX)/share/man/man1/sxiv.1
	chmod 644 $(PREFIX)/share/man/man1/sxiv.1

clean:
	rm -f sxiv *.o

tags: *.h *.c
	ctags $^

cscope: *.h *.c
	cscope -b