Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 66 lines (51 sloc) 1.64 kb
8f99adb Bert Münnich Made XFLAGS & XLIBS macros only
authored
1 VERSION = git-20110912
e7bc3bb Bert Münnich Non-working skeleton
authored
2
b96c106 Bert Münnich Overhauled building
authored
3 CC = gcc
4 CFLAGS = -Wall -pedantic -O2
03009f5 Bert Münnich Made Makefile POSIX compliant
authored
5 LDFLAGS =
b96c106 Bert Münnich Overhauled building
authored
6 LIBS = -lX11 -lImlib2
7
8 PREFIX = /usr/local
9 MANPREFIX = $(PREFIX)/share/man
e7bc3bb Bert Münnich Non-working skeleton
authored
10
1d74938 Bert Münnich Put event handling back into main.c; events -> commands
authored
11 SRC = commands.c image.c main.c options.c thumbs.c util.c window.c
03009f5 Bert Münnich Made Makefile POSIX compliant
authored
12 OBJ = $(SRC:.c=.o)
e7bc3bb Bert Münnich Non-working skeleton
authored
13
b96c106 Bert Münnich Overhauled building
authored
14 all: options sxiv
e7bc3bb Bert Münnich Non-working skeleton
authored
15
b96c106 Bert Münnich Overhauled building
authored
16 options:
17 @echo "sxiv build options:"
18 @echo "CC = $(CC)"
19 @echo "CFLAGS = $(CFLAGS)"
20 @echo "LDFLAGS = $(LDFLAGS)"
21 @echo "PREFIX = $(PREFIX)"
0a171a9 Bert Münnich Fixed dependency on Makefile & config.h
authored
22
23 .c.o:
b96c106 Bert Münnich Overhauled building
authored
24 @echo "CC $<"
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
25 @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
26
27 $(OBJ) XLIBS: Makefile config.h
e7bc3bb Bert Münnich Non-working skeleton
authored
28
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
29 XLIBS: XLIBS.c
30 @$(CC) $(CFLAGS) -o $@ $@.c
b96c106 Bert Münnich Overhauled building
authored
31
32 config.h:
33 @echo "creating $@ from config.def.h"
34 @cp config.def.h $@
35
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
36 sxiv: $(OBJ) XLIBS
b96c106 Bert Münnich Overhauled building
authored
37 @echo "CC -o $@"
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
38 @$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $$(./XLIBS)
e7bc3bb Bert Münnich Non-working skeleton
authored
39
40 clean:
b96c106 Bert Münnich Overhauled building
authored
41 @echo "cleaning"
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
42 @rm -f $(OBJ) XLIBS sxiv sxiv-$(VERSION).tar.gz
b96c106 Bert Münnich Overhauled building
authored
43
44 dist: clean
45 @echo "creating dist tarball"
46 @mkdir -p sxiv-$(VERSION)
dad06c7 Bert Münnich Much nicer handling of compile-time features
authored
47 @cp LICENSE Makefile README.md config.def.h sxiv.1 $(SRC) XLIBS.c \
48 sxiv-$(VERSION)
b96c106 Bert Münnich Overhauled building
authored
49 @tar -cf sxiv-$(VERSION).tar sxiv-$(VERSION)
50 @gzip sxiv-$(VERSION).tar
51 @rm -rf sxiv-$(VERSION)
52
53 install: all
54 @echo "installing executable file to $(DESTDIR)$(PREFIX)/bin"
55 @install -D -m 755 sxiv $(DESTDIR)$(PREFIX)/bin/sxiv
56 @echo "installing manual page to $(DESTDIR)$(MANPREFIX)/man1"
57 @mkdir -p $(DESTDIR)$(MANPREFIX)/man1
58 @sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
59 @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
60
61 uninstall:
62 @echo "removing executable file from $(DESTDIR)$(PREFIX)/bin"
63 @rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
64 @echo "removing manual page from $(DESTDIR)$(MANPREFIX)/man1"
65 @rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
Something went wrong with that request. Please try again.