surf/Makefile

99 lines
2.6 KiB
Makefile
Raw Normal View History

2009-06-05 13:22:40 +02:00
# surf - simple browser
# See LICENSE file for copyright and license details.
.POSIX:
2009-06-05 13:22:40 +02:00
include config.mk
SRC = surf.c
OBJ = $(SRC:.c=.o)
2015-11-23 22:12:00 +01:00
LIBSRC = libsurf-webext.c
LIBOBJ = $(LIBSRC:.c=.lo)
2009-06-05 13:22:40 +02:00
2015-11-23 22:12:00 +01:00
all: options libsurf-webext.la surf
2009-06-05 13:22:40 +02:00
options:
@echo surf build options:
2015-11-23 22:12:00 +01:00
@echo "CFLAGS = $(SURFCFLAGS)"
@echo "LDFLAGS = $(SURFLDFLAGS)"
@echo "CC = $(CC)"
@echo "LIBCFLAGS = $(LIBCFLAGS)"
@echo "LIBLDFLAGS = $(LIBLDFLAGS)"
@echo "LIBTOOL = $(LIBTOOL)"
2009-06-05 13:22:40 +02:00
.c.o:
@echo CC -c $<
2015-11-23 22:12:00 +01:00
@$(CC) $(SURFCFLAGS) -c $<
.c.lo:
@echo libtool compile $<
@$(LIBTOOL) --mode compile --tag CC $(CC) $(LIBCFLAGS) -c $<
2009-06-05 13:22:40 +02:00
$(OBJ): config.h config.mk
2015-11-23 22:12:00 +01:00
$(LIBOBJ): config.mk
2009-09-07 11:43:31 +02:00
config.h:
@echo creating $@ from config.def.h
@cp config.def.h $@
2009-06-05 13:22:40 +02:00
2015-11-23 22:12:00 +01:00
libsurf-webext.la: $(LIBOBJ)
@echo libtool link $@
@$(LIBTOOL) --mode link --tag CC $(CC) $(LIBLDFLAGS) -o $@ \
$(LIBOBJ) -rpath $(DESTDIR)$(LIBPREFIX)
surf: $(OBJ)
2009-06-05 13:22:40 +02:00
@echo CC -o $@
2015-11-23 22:12:00 +01:00
@$(CC) $(SURFCFLAGS) -o $@ $(OBJ) $(SURFLDFLAGS)
clean-lib:
@echo cleaning library
@rm -rf libsurf-webext.la .libs $(LIBOBJ) $(LIBOBJ:.lo=.o)
2015-11-23 22:12:00 +01:00
clean: clean-lib
2009-06-05 13:22:40 +02:00
@echo cleaning
@rm -f surf $(OBJ)
2009-06-05 13:22:40 +02:00
distclean: clean
@echo cleaning dist
@rm -f config.h surf-$(VERSION).tar.gz
dist: distclean
2009-06-05 13:22:40 +02:00
@echo creating dist tarball
@mkdir -p surf-$(VERSION)
2009-09-11 09:38:53 +02:00
@cp -R LICENSE Makefile config.mk config.def.h README \
surf-open.sh arg.h TODO.md surf.png \
2015-11-23 22:12:00 +01:00
surf.1 $(SRC) $(LIBSRC) surf-$(VERSION)
@tar -cf surf-$(VERSION).tar surf-$(VERSION)
@gzip surf-$(VERSION).tar
@rm -rf surf-$(VERSION)
2009-06-05 13:22:40 +02:00
2015-11-23 22:12:00 +01:00
install-lib: libsurf-webext.la
@echo installing library file to $(DESTDIR)$(LIBPREFIX)
@mkdir -p $(DESTDIR)$(LIBPREFIX)
@$(LIBTOOL) --mode install install -c libsurf-webext.la \
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
install: all install-lib
@echo installing executable file to $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(PREFIX)/bin
@cp -f surf $(DESTDIR)$(PREFIX)/bin
@chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
@echo installing manual page to $(DESTDIR)$(MANPREFIX)/man1
@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 13:22:40 +02:00
2015-11-23 22:12:00 +01:00
uninstall-lib:
@echo removing library file from $(DESTDIR)$(LIBPREFIX)
@$(LIBTOOL) --mode uninstall rm -f \
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
@- rm -df $(DESTDIR)$(LIBPREFIX)
uninstall: uninstall-lib
@echo removing executable file from $(DESTDIR)$(PREFIX)/bin
@rm -f $(DESTDIR)$(PREFIX)/bin/surf
@echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
@rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
2009-06-05 13:22:40 +02:00
2015-11-23 22:12:00 +01:00
.SUFFIXES: .la .lo .o .c
.PHONY: all options clean-dist clean dist install-lib install uninstall-lib uninstall