2009-06-05 13:22:40 +02:00
|
|
|
# surf - simple browser
|
|
|
|
# See LICENSE file for copyright and license details.
|
2017-04-29 15:21:49 +02:00
|
|
|
.POSIX:
|
2009-06-05 13:22:40 +02:00
|
|
|
|
|
|
|
include config.mk
|
|
|
|
|
2009-06-06 09:35:50 +02:00
|
|
|
SRC = surf.c
|
2017-04-29 15:21:49 +02:00
|
|
|
OBJ = $(SRC:.c=.o)
|
2009-06-05 13:22:40 +02:00
|
|
|
|
2009-06-06 09:35:50 +02:00
|
|
|
all: options surf
|
2009-06-05 13:22:40 +02:00
|
|
|
|
|
|
|
options:
|
|
|
|
@echo surf build options:
|
2017-04-29 15:21:49 +02:00
|
|
|
@echo "CFLAGS = $(SURF_CFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(SURF_LDFLAGS)"
|
|
|
|
@echo "CC = $(CC)"
|
2009-06-05 13:22:40 +02:00
|
|
|
|
|
|
|
.c.o:
|
2017-04-29 15:21:49 +02:00
|
|
|
@echo CC -c $<
|
|
|
|
@$(CC) $(SURF_CFLAGS) -c $<
|
2009-06-05 13:22:40 +02:00
|
|
|
|
2017-04-29 15:21:49 +02:00
|
|
|
$(OBJ): config.h 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
|
|
|
|
2017-04-29 15:21:49 +02:00
|
|
|
surf: $(OBJ)
|
2009-06-05 13:22:40 +02:00
|
|
|
@echo CC -o $@
|
2017-04-29 15:21:49 +02:00
|
|
|
@$(CC) $(SURF_CFLAGS) -o $@ $(OBJ) $(SURF_LDFLAGS)
|
2009-06-05 20:16:10 +02:00
|
|
|
|
2009-06-05 13:22:40 +02:00
|
|
|
clean:
|
|
|
|
@echo cleaning
|
2017-04-29 15:21:49 +02:00
|
|
|
@rm -f surf $(OBJ)
|
2009-06-05 13:22:40 +02:00
|
|
|
|
2017-04-29 15:21:49 +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
|
2017-04-29 15:21:49 +02:00
|
|
|
@mkdir -p surf-$(VERSION)
|
2009-09-11 09:38:53 +02:00
|
|
|
@cp -R LICENSE Makefile config.mk config.def.h README \
|
2017-04-29 15:21:49 +02:00
|
|
|
surf-open.sh arg.h TODO.md surf.png \
|
|
|
|
surf.1 $(SRC) 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
|
|
|
|
|
|
|
install: all
|
2017-04-29 15:21:49 +02:00
|
|
|
@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
|
|
|
|
|
|
|
uninstall:
|
2017-04-29 15:21:49 +02:00
|
|
|
@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
|
|
|
|
|
|
|
.PHONY: all options clean dist install uninstall
|