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