chibipub

experimental activitypub node in C
git clone git://jb55.com/chibipub
Log | Files | Refs | README | LICENSE

Makefile (1642B)


      1 
      2 CFLAGS = -Og -ggdb -Wall -Werror -Ideps -Isrc $(shell pkg-config --cflags openssl libcurl)
      3 LDFLAGS = $(shell pkg-config --libs openssl libcurl)
      4 
      5 OBJS = src/http.o \
      6        src/base64.o \
      7        src/inbox.o \
      8        src/outbox.o \
      9        src/json.o \
     10        src/ubjson.o \
     11        src/ap_json.o \
     12        src/io.o \
     13        src/util.o \
     14        src/sigcheck.o \
     15        src/hex.o \
     16        src/post.o \
     17        src/chibipub.o \
     18        deps/sha256/sha256.o \
     19        deps/blake3/blake3.a
     20 
     21 BLAKE3_OBJS = deps/blake3/blake3.o \
     22 	      deps/blake3/blake3_dispatch.o \
     23 	      deps/blake3/blake3_portable.o \
     24 	      deps/blake3/blake3_sse2_x86-64_unix.o \
     25 	      deps/blake3/blake3_sse41_x86-64_unix.o \
     26 	      deps/blake3/blake3_avx2_x86-64_unix.o \
     27 	      deps/blake3/blake3_avx512_x86-64_unix.o \
     28 
     29 HEADERS = $(wildcard src/*.h) deps/sha256/sha256.h
     30 
     31 all: chibipub
     32 
     33 %.o: %.c
     34 	@echo "cc $<"
     35 	@$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
     36 
     37 %.o: %.c %.h
     38 	@echo "cc $<"
     39 	@$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
     40 
     41 %.o: %.S
     42 	@echo "cc $<"
     43 	@$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
     44 
     45 deps/blake3/blake3.a: $(BLAKE3_OBJS)
     46 	@echo "ar $@"
     47 	@ar rcs $@ $(BLAKE3_OBJS)
     48 
     49 corpus/math.json:
     50 	curl --compressed -sL 'https://jb55.com/s/5aaaae6d64be61fd.json' > $@
     51 
     52 chibipub: src/main.c $(OBJS) $(HEADERS)
     53 	@echo "ld $@"
     54 	@$(CC) $(CFLAGS) $< $(OBJS) $(LDFLAGS) -o $@
     55 
     56 src/test_json: src/test_json.c $(OBJS) $(HEADERS) corpus/math.json
     57 	$(CC) $(CFLAGS) $< $(OBJS) $(LDFLAGS) -o $@
     58 
     59 check: src/test_json
     60 	./src/test_json
     61 
     62 clean: fake
     63 	rm -f $(OBJS) $(BLAKE3_OBJS) deps/blake3/blake3.a chibipub src/test_json
     64 
     65 tags: fake
     66 	ctags src/*.c deps/sha256/sha256.c $(HEADERS)
     67 
     68 .PHONY: fake