snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

Makefile (3356B)


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