Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # surf - simple browser
  2. # See LICENSE file for copyright and license details.
  3. include config.mk
  4. SRC = surf.c
  5. OBJ = ${SRC:.c=.o}
  6. all: options surf
  7. options:
  8. @echo surf build options:
  9. @echo "CFLAGS = ${CFLAGS}"
  10. @echo "LDFLAGS = ${LDFLAGS}"
  11. @echo "CC = ${CC}"
  12. .c.o:
  13. @echo CC $<
  14. @${CC} -c ${CFLAGS} $<
  15. ${OBJ}: config.h config.mk
  16. config.h:
  17. @echo creating $@ from config.def.h
  18. @cp config.def.h $@
  19. surf: ${OBJ}
  20. @echo CC -o $@
  21. @${CC} -o $@ surf.o ${LDFLAGS}
  22. clean:
  23. @echo cleaning
  24. @rm -f surf ${OBJ} surf-${VERSION}.tar.gz
  25. dist: clean
  26. @echo creating dist tarball
  27. @mkdir -p surf-${VERSION}
  28. @cp -R LICENSE Makefile config.mk config.def.h README \
  29. surf-open.sh arg.h TODO.md surf.png \
  30. surf.1 ${SRC} surf-${VERSION}
  31. @tar -cf surf-${VERSION}.tar surf-${VERSION}
  32. @gzip surf-${VERSION}.tar
  33. @rm -rf surf-${VERSION}
  34. install: all
  35. @echo installing executable file to ${DESTDIR}${PREFIX}/bin
  36. @mkdir -p ${DESTDIR}${PREFIX}/bin
  37. @cp -f surf ${DESTDIR}${PREFIX}/bin
  38. @chmod 755 ${DESTDIR}${PREFIX}/bin/surf
  39. @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
  40. @mkdir -p ${DESTDIR}${MANPREFIX}/man1
  41. @sed "s/VERSION/${VERSION}/g" < surf.1 > ${DESTDIR}${MANPREFIX}/man1/surf.1
  42. @chmod 644 ${DESTDIR}${MANPREFIX}/man1/surf.1
  43. uninstall:
  44. @echo removing executable file from ${DESTDIR}${PREFIX}/bin
  45. @rm -f ${DESTDIR}${PREFIX}/bin/surf
  46. @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
  47. @rm -f ${DESTDIR}${MANPREFIX}/man1/surf.1
  48. .PHONY: all options clean dist install uninstall