1 # surf - simple browser
2 # See LICENSE file for copyright and license details.
9 WEBEXTSRC = libsurf-webext.c
10 WEBEXTOBJ = $(WEBEXTSRC:.c=.o)
12 all: options libsurf-webext.so surf
15 @echo surf build options:
17 @echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)"
18 @echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)"
19 @echo "LDFLAGS = $(LDFLAGS)"
22 $(CC) $(SURFCFLAGS) $(CFLAGS) -c $<
27 $(OBJ): config.h config.mk
29 $(WEBEXTOBJ): config.h config.mk
30 $(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WEBEXTSRC)
32 libsurf-webext.so: $(WEBEXTOBJ)
33 $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS) -lc
36 $(CC) $(SURFLDLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
40 rm -f libsurf-webext.so $(WEBEXTOBJ)
43 rm -f config.h surf-$(VERSION).tar.gz
46 mkdir -p surf-$(VERSION)
47 cp -R LICENSE Makefile config.mk config.def.h README \
48 surf-open.sh arg.h TODO.md surf.png \
49 surf.1 $(SRC) $(WEBEXTSRC) surf-$(VERSION)
50 tar -cf surf-$(VERSION).tar surf-$(VERSION)
51 gzip surf-$(VERSION).tar
52 rm -rf surf-$(VERSION)
55 mkdir -p $(DESTDIR)$(PREFIX)/bin
56 cp -f surf $(DESTDIR)$(PREFIX)/bin
57 chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
58 mkdir -p $(DESTDIR)$(LIBDIR)
59 cp -f libsurf-webext.so $(DESTDIR)$(LIBDIR)
60 chmod 644 $(DESTDIR)$(LIBDIR)/libsurf-webext.so
61 mkdir -p $(DESTDIR)$(MANPREFIX)/man1
62 sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
63 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
66 rm -f $(DESTDIR)$(PREFIX)/bin/surf
67 rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
68 rm -f $(DESTDIR)$(LIBDIR)/libsurf-webext.so
69 - rmdir $(DESTDIR)$(LIBDIR)
72 .PHONY: all options clean-dist clean dist install uninstall