Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. PREFIX=/usr/local
  2. PREFIX_MAN=$(PREFIX)/man
  3. CFLAGS?=-g -Wall -Wextra -pedantic
  4. all: snac
  5. snac: snac.o main.o data.o http.o httpd.o webfinger.o \
  6. activitypub.o html.o utils.o format.o upgrade.o mastoapi.o
  7. $(CC) $(CFLAGS) -L/usr/local/lib *.o -lcurl -lcrypto $(LDFLAGS) -pthread -o $@
  8. .c.o:
  9. $(CC) $(CFLAGS) $(CPPFLAGS) -I/usr/local/include -c $<
  10. clean:
  11. rm -rf *.o *.core snac makefile.depend
  12. dep:
  13. $(CC) -I/usr/local/include -MM *.c > makefile.depend
  14. install:
  15. mkdir -p -m 755 $(PREFIX)/bin
  16. install -m 755 snac $(PREFIX)/bin/snac
  17. mkdir -p -m 755 $(PREFIX_MAN)/man1
  18. install -m 644 doc/snac.1 $(PREFIX_MAN)/man1/snac.1
  19. mkdir -p -m 755 $(PREFIX_MAN)/man5
  20. install -m 644 doc/snac.5 $(PREFIX_MAN)/man5/snac.5
  21. mkdir -p -m 755 $(PREFIX_MAN)/man8
  22. install -m 644 doc/snac.8 $(PREFIX_MAN)/man8/snac.8
  23. uninstall:
  24. rm $(PREFIX)/bin/snac
  25. rm $(PREFIX_MAN)/man1/snac.1
  26. rm $(PREFIX_MAN)/man5/snac.5
  27. rm $(PREFIX_MAN)/man8/snac.8
  28. activitypub.o: activitypub.c xs.h xs_json.h xs_curl.h xs_mime.h \
  29. xs_openssl.h xs_regex.h xs_time.h xs_set.h xs_match.h snac.h \
  30. http_codes.h
  31. data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
  32. xs_set.h xs_time.h xs_regex.h xs_match.h xs_unicode.h xs_random.h snac.h \
  33. http_codes.h
  34. format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
  35. xs_time.h snac.h http_codes.h
  36. html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
  37. xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h snac.h http_codes.h
  38. http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
  39. snac.h http_codes.h
  40. httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
  41. xs_httpd.h xs_mime.h xs_time.h xs_openssl.h xs_fcgi.h xs_html.h snac.h \
  42. http_codes.h
  43. main.o: main.c xs.h xs_io.h xs_json.h xs_time.h xs_openssl.h snac.h \
  44. http_codes.h
  45. mastoapi.o: mastoapi.c xs.h xs_hex.h xs_openssl.h xs_json.h xs_io.h \
  46. xs_time.h xs_glob.h xs_set.h xs_random.h xs_url.h xs_mime.h xs_match.h \
  47. snac.h http_codes.h
  48. snac.o: snac.c xs.h xs_hex.h xs_io.h xs_unicode_tbl.h xs_unicode.h \
  49. xs_json.h xs_curl.h xs_openssl.h xs_socket.h xs_unix_socket.h xs_url.h \
  50. xs_httpd.h xs_mime.h xs_regex.h xs_set.h xs_time.h xs_glob.h xs_random.h \
  51. xs_match.h xs_fcgi.h xs_html.h snac.h http_codes.h
  52. upgrade.o: upgrade.c xs.h xs_io.h xs_json.h xs_glob.h snac.h http_codes.h
  53. utils.o: utils.c xs.h xs_io.h xs_json.h xs_time.h xs_openssl.h \
  54. xs_random.h xs_glob.h xs_curl.h xs_regex.h snac.h http_codes.h
  55. webfinger.o: webfinger.c xs.h xs_json.h xs_curl.h xs_mime.h snac.h \
  56. http_codes.h