Krolyxon
Commit 00e6cd2

Branches

Refs →

nsxivMakefile

34 lines · 656 B · Makefile

1all: sxiv
2
3VERSION=git-20110522
4
5CC?=gcc
6DESTDIR?=
7PREFIX?=/usr/local
8CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\"
9LDFLAGS+=
10LIBS+= -lX11 -lImlib2
11
12SRCFILES=$(wildcard *.c)
13OBJFILES=$(SRCFILES:.c=.o)
14
15sxiv: $(OBJFILES)
16 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
17
18%.o: %.c Makefile config.h
19 $(CC) $(CFLAGS) -c -o $@ $<
20
21install: all
22 install -D -m 755 -o root -g root sxiv $(DESTDIR)$(PREFIX)/bin/sxiv
23 mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
24 sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(PREFIX)/share/man/man1/sxiv.1
25 chmod 644 $(DESTDIR)$(PREFIX)/share/man/man1/sxiv.1
26
27clean:
28 rm -f sxiv *.o
29
30tags: *.h *.c
31 ctags $^
32
33cscope: *.h *.c
34 cscope -b