Add config option for microphone and webcam access
[surf.git] / Makefile
1 # surf - simple browser
2 # See LICENSE file for copyright and license details.
3 .POSIX:
4
5 include config.mk
6
7 SRC = surf.c
8 OBJ = $(SRC:.c=.o)
9
10 all: options surf
11
12 options:
13         @echo surf build options:
14         @echo "CFLAGS   = $(SURF_CFLAGS)"
15         @echo "LDFLAGS  = $(SURF_LDFLAGS)"
16         @echo "CC       = $(CC)"
17
18 .c.o:
19         @echo CC -c $<
20         @$(CC) $(SURF_CFLAGS) -c $<
21
22 $(OBJ): config.h config.mk
23
24 config.h:
25         @echo creating $@ from config.def.h
26         @cp config.def.h $@
27
28 surf: $(OBJ)
29         @echo CC -o $@
30         @$(CC) $(SURF_CFLAGS) -o $@ $(OBJ) $(SURF_LDFLAGS)
31
32 clean:
33         @echo cleaning
34         @rm -f surf $(OBJ)
35
36 distclean: clean
37         @echo cleaning dist
38         @rm -f config.h surf-$(VERSION).tar.gz
39
40 dist: distclean
41         @echo creating dist tarball
42         @mkdir -p surf-$(VERSION)
43         @cp -R LICENSE Makefile config.mk config.def.h README \
44             surf-open.sh arg.h TODO.md surf.png \
45             surf.1 $(SRC) surf-$(VERSION)
46         @tar -cf surf-$(VERSION).tar surf-$(VERSION)
47         @gzip surf-$(VERSION).tar
48         @rm -rf surf-$(VERSION)
49
50 install: all
51         @echo installing executable file to $(DESTDIR)$(PREFIX)/bin
52         @mkdir -p $(DESTDIR)$(PREFIX)/bin
53         @cp -f surf $(DESTDIR)$(PREFIX)/bin
54         @chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
55         @echo installing manual page to $(DESTDIR)$(MANPREFIX)/man1
56         @mkdir -p $(DESTDIR)$(MANPREFIX)/man1
57         @sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
58         @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
59
60 uninstall:
61         @echo removing executable file from $(DESTDIR)$(PREFIX)/bin
62         @rm -f $(DESTDIR)$(PREFIX)/bin/surf
63         @echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
64         @rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
65
66 .PHONY: all options clean dist install uninstall