surf/Makefile

84 lines
2.1 KiB
Makefile
Raw Normal View History

2009-06-05 11:22:40 +00:00
# surf - simple browser
# See LICENSE file for copyright and license details.
.POSIX:
2009-06-05 11:22:40 +00:00
include config.mk
SRC = surf.c common.c
OBJ = $(SRC:.c=.o)
LIBSRC = libsurf-webext.c common.c
2015-11-23 21:12:00 +00:00
LIBOBJ = $(LIBSRC:.c=.lo)
2009-06-05 11:22:40 +00:00
2015-11-23 21:12:00 +00:00
all: options libsurf-webext.la surf
2009-06-05 11:22:40 +00:00
options:
@echo surf build options:
2015-11-23 21:12:00 +00:00
@echo "CFLAGS = $(SURFCFLAGS)"
@echo "LDFLAGS = $(SURFLDFLAGS)"
@echo "CC = $(CC)"
@echo "LIBCFLAGS = $(LIBCFLAGS)"
@echo "LIBLDFLAGS = $(LIBLDFLAGS)"
@echo "LIBTOOL = $(LIBTOOL)"
2009-06-05 11:22:40 +00:00
.c.o:
2018-10-08 10:34:47 +00:00
$(CC) $(SURFCFLAGS) -c $<
2015-11-23 21:12:00 +00:00
.c.lo:
2018-10-08 10:34:47 +00:00
$(LIBTOOL) --mode compile --tag CC $(CC) $(LIBCFLAGS) -c $<
2009-06-05 11:22:40 +00:00
$(OBJ): config.h config.mk
$(LIBOBJ): config.h config.mk
2009-09-07 09:43:31 +00:00
config.h:
2018-10-08 10:34:47 +00:00
cp config.def.h $@
2009-06-05 11:22:40 +00:00
2015-11-23 21:12:00 +00:00
libsurf-webext.la: $(LIBOBJ)
2018-10-08 10:34:47 +00:00
$(LIBTOOL) --mode link --tag CC $(CC) $(LIBLDFLAGS) -o $@ \
$(LIBOBJ) $(LIB) -rpath $(DESTDIR)$(LIBPREFIX)
2015-11-23 21:12:00 +00:00
surf: $(OBJ)
2018-10-08 10:34:47 +00:00
$(CC) $(SURFCFLAGS) -o $@ $(OBJ) $(SURFLDFLAGS)
2015-11-23 21:12:00 +00:00
clean-lib:
2018-10-08 10:34:47 +00:00
rm -rf libsurf-webext.la .libs $(LIBOBJ) $(LIBOBJ:.lo=.o)
2015-11-23 21:12:00 +00:00
clean: clean-lib
2018-10-08 10:34:47 +00:00
rm -f surf $(OBJ)
2009-06-05 11:22:40 +00:00
distclean: clean
2018-10-08 10:34:47 +00:00
rm -f config.h surf-$(VERSION).tar.gz
dist: distclean
2018-10-08 10:34:47 +00:00
mkdir -p surf-$(VERSION)
cp -R LICENSE Makefile config.mk config.def.h README \
surf-open.sh arg.h TODO.md surf.png \
2015-11-23 21:12:00 +00:00
surf.1 $(SRC) $(LIBSRC) 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
2015-11-23 21:12:00 +00:00
install-lib: libsurf-webext.la
2018-10-08 10:34:47 +00:00
mkdir -p $(DESTDIR)$(LIBPREFIX)
$(LIBTOOL) --mode install install -c libsurf-webext.la \
2015-11-23 21:12:00 +00:00
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
install: all install-lib
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
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
2015-11-23 21:12:00 +00:00
uninstall-lib:
2018-10-08 10:34:47 +00:00
$(LIBTOOL) --mode uninstall rm -f \
2015-11-23 21:12:00 +00:00
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
2018-10-08 10:34:47 +00:00
- rm -df $(DESTDIR)$(LIBPREFIX)
2015-11-23 21:12:00 +00:00
uninstall: uninstall-lib
2018-10-08 10:34:47 +00:00
rm -f $(DESTDIR)$(PREFIX)/bin/surf
rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
2009-06-05 11:22:40 +00:00
2015-11-23 21:12:00 +00:00
.SUFFIXES: .la .lo .o .c
.PHONY: all options clean-dist clean dist install-lib install uninstall-lib uninstall