Makefile 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. PREFIX?=/usr/local
  2. PREFIX_MAN=$(PREFIX)/man
  3. CFLAGS?=-g -Wall -Wextra -pedantic
  4. all: snac
  5. snac: snac.o main.o sandbox.o data.o http.o httpd.o webfinger.o \
  6. activitypub.o html.o utils.o format.o upgrade.o mastoapi.o rss.o
  7. $(CC) $(CFLAGS) -L$(PREFIX)/lib *.o -lcurl -lcrypto $(LDFLAGS) -pthread -o $@
  8. test: tests/smtp
  9. tests/smtp: tests/smtp.o
  10. $(CC) $(CFLAGS) -L$(PREFIX)/lib $< -lcurl $(LDFLAGS) -o $@
  11. .c.o:
  12. $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PREFIX)/include -c $< -o $@
  13. clean:
  14. rm -rf *.o tests/*.o tests/smtp *.core snac makefile.depend
  15. dep:
  16. $(CC) -I$(PREFIX)/include -MM *.c > makefile.depend
  17. install:
  18. mkdir -p -m 755 $(PREFIX)/bin
  19. install -m 755 snac $(PREFIX)/bin/snac
  20. mkdir -p -m 755 $(PREFIX_MAN)/man1
  21. install -m 644 doc/snac.1 $(PREFIX_MAN)/man1/snac.1
  22. mkdir -p -m 755 $(PREFIX_MAN)/man5
  23. install -m 644 doc/snac.5 $(PREFIX_MAN)/man5/snac.5
  24. mkdir -p -m 755 $(PREFIX_MAN)/man8
  25. install -m 644 doc/snac.8 $(PREFIX_MAN)/man8/snac.8
  26. uninstall:
  27. rm $(PREFIX)/bin/snac
  28. rm $(PREFIX_MAN)/man1/snac.1
  29. rm $(PREFIX_MAN)/man5/snac.5
  30. rm $(PREFIX_MAN)/man8/snac.8
  31. update-po:
  32. mkdir -p po
  33. [ -f "po/en.po" ] || xgettext -o po/en.po --language=C --keyword=L --keyword=LL --from-code=utf-8 *.c
  34. for a in po/*.po ; do \
  35. sed -i -e '/^#:/d' $$a ; \
  36. xgettext --omit-header -j -o $$a --language=C --keyword=L --keyword=LL --from-code=utf-8 *.c ; \
  37. done
  38. activitypub.o: activitypub.c xs.h xs_json.h xs_curl.h xs_url.h xs_mime.h \
  39. xs_openssl.h xs_regex.h xs_time.h xs_set.h xs_match.h xs_unicode.h \
  40. xs_webmention.h xs_http.h xs_http_codes.h snac.h
  41. data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
  42. xs_set.h xs_time.h xs_regex.h xs_match.h xs_unicode.h xs_random.h \
  43. xs_po.h xs_http.h xs_http_codes.h snac.h
  44. format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
  45. xs_time.h xs_match.h xs_unicode.h snac.h
  46. html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
  47. xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h xs_unicode.h xs_url.h \
  48. xs_random.h xs_http.h xs_http_codes.h snac.h
  49. http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
  50. xs_http.h xs_http_codes.h snac.h
  51. httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
  52. xs_http.h xs_http_codes.h xs_httpd.h xs_mime.h xs_time.h xs_openssl.h \
  53. xs_fcgi.h xs_html.h xs_webmention.h snac.h
  54. main.o: main.c xs.h xs_io.h xs_json.h xs_time.h xs_openssl.h xs_match.h \
  55. xs_random.h xs_http.h xs_http_codes.h snac.h
  56. mastoapi.o: mastoapi.c xs.h xs_hex.h xs_openssl.h xs_json.h xs_io.h \
  57. xs_time.h xs_glob.h xs_set.h xs_random.h xs_url.h xs_mime.h xs_match.h \
  58. xs_unicode.h xs_http.h xs_http_codes.h snac.h
  59. rss.o: rss.c xs.h xs_html.h xs_regex.h xs_time.h xs_match.h xs_curl.h \
  60. xs_openssl.h xs_json.h xs_http.h xs_http_codes.h xs_unicode.h snac.h
  61. sandbox.o: sandbox.c xs.h snac.h
  62. snac.o: snac.c xs.h xs_hex.h xs_io.h xs_unicode_tbl.h xs_unicode.h \
  63. xs_json.h xs_curl.h xs_openssl.h xs_socket.h xs_unix_socket.h xs_url.h \
  64. xs_http.h xs_http_codes.h xs_httpd.h xs_mime.h xs_regex.h xs_set.h \
  65. xs_time.h xs_glob.h xs_random.h xs_match.h xs_fcgi.h xs_html.h xs_po.h \
  66. xs_webmention.h xs_list_tools.h snac.h
  67. upgrade.o: upgrade.c xs.h xs_io.h xs_json.h xs_glob.h snac.h
  68. utils.o: utils.c xs.h xs_io.h xs_json.h xs_time.h xs_openssl.h \
  69. xs_random.h xs_glob.h xs_curl.h xs_regex.h xs_http.h xs_http_codes.h \
  70. xs_list_tools.h xs_set.h snac.h
  71. webfinger.o: webfinger.c xs.h xs_json.h xs_curl.h xs_mime.h xs_http.h \
  72. xs_http_codes.h snac.h