2009-06-05 11:22:40 +00:00
|
|
|
# surf - simple browser
|
|
|
|
# See LICENSE file for copyright and license details.
|
2017-04-29 13:21:49 +00:00
|
|
|
.POSIX:
|
2009-06-05 11:22:40 +00:00
|
|
|
|
|
|
|
include config.mk
|
|
|
|
|
2016-01-04 15:09:12 +00:00
|
|
|
SRC = surf.c common.c
|
2017-04-29 13:21:49 +00:00
|
|
|
OBJ = $(SRC:.c=.o)
|
2018-10-08 11:47:25 +00:00
|
|
|
WEBEXTSRC = libsurf-webext.c
|
|
|
|
WEBEXTOBJ = $(WEBEXTSRC:.c=.o)
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
all: options libsurf-webext.so surf
|
2009-06-05 11:22:40 +00:00
|
|
|
|
|
|
|
options:
|
|
|
|
@echo surf build options:
|
2018-10-08 11:47:25 +00:00
|
|
|
@echo "CC = $(CC)"
|
|
|
|
@echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)"
|
|
|
|
@echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(LDFLAGS)"
|
2009-06-05 11:22:40 +00:00
|
|
|
|
|
|
|
.c.o:
|
2018-10-08 11:47:25 +00:00
|
|
|
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $<
|
2015-11-23 21:12:00 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
config.h:
|
|
|
|
cp config.def.h $@
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-09 10:26:32 +00:00
|
|
|
$(OBJ): config.h common.h config.mk
|
2009-09-07 09:43:31 +00:00
|
|
|
|
2018-10-09 10:26:32 +00:00
|
|
|
$(WEBEXTOBJ): $(WEBEXTSRC) config.h common.h config.mk
|
2018-10-08 11:47:25 +00:00
|
|
|
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WEBEXTSRC)
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
libsurf-webext.so: $(WEBEXTOBJ)
|
|
|
|
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS) -lc
|
2015-11-23 21:12:00 +00:00
|
|
|
|
2017-04-29 13:21:49 +00:00
|
|
|
surf: $(OBJ)
|
2018-10-08 11:47:25 +00:00
|
|
|
$(CC) $(SURFLDLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
2015-11-23 21:12:00 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
clean:
|
2018-10-08 10:34:47 +00:00
|
|
|
rm -f surf $(OBJ)
|
2018-10-08 11:47:25 +00:00
|
|
|
rm -f libsurf-webext.so $(WEBEXTOBJ)
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2017-04-29 13:21:49 +00:00
|
|
|
distclean: clean
|
2018-10-08 10:34:47 +00:00
|
|
|
rm -f config.h surf-$(VERSION).tar.gz
|
2017-04-29 13:21:49 +00:00
|
|
|
|
|
|
|
dist: distclean
|
2018-10-08 10:34:47 +00:00
|
|
|
mkdir -p surf-$(VERSION)
|
|
|
|
cp -R LICENSE Makefile config.mk config.def.h README \
|
2017-04-29 13:21:49 +00:00
|
|
|
surf-open.sh arg.h TODO.md surf.png \
|
2018-10-08 11:47:25 +00:00
|
|
|
surf.1 $(SRC) $(WEBEXTSRC) surf-$(VERSION)
|
2018-10-08 10:34:47 +00:00
|
|
|
tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
|
|
|
gzip surf-$(VERSION).tar
|
|
|
|
rm -rf surf-$(VERSION)
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
install: all
|
2018-10-08 10:34:47 +00:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp -f surf $(DESTDIR)$(PREFIX)/bin
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
|
2018-10-08 12:11:24 +00:00
|
|
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
|
|
|
cp -f libsurf-webext.so $(DESTDIR)$(LIBDIR)
|
2018-10-08 12:23:51 +00:00
|
|
|
chmod 644 $(DESTDIR)$(LIBDIR)/libsurf-webext.so
|
2018-10-08 10:34:47 +00:00
|
|
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
|
|
|
sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
|
|
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
uninstall:
|
2018-10-08 10:34:47 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
2018-10-08 12:11:24 +00:00
|
|
|
rm -f $(DESTDIR)$(LIBDIR)/libsurf-webext.so
|
|
|
|
- rmdir $(DESTDIR)$(LIBDIR)
|
2009-06-05 11:22:40 +00:00
|
|
|
|
2018-10-08 11:47:25 +00:00
|
|
|
.SUFFIXES: .so .o .c
|
|
|
|
.PHONY: all options clean-dist clean dist install uninstall
|