sfinx

sphincs+ inspired signing utility
git clone git://git.finwo.net/app/sfinx
Log | Files | Refs | README | LICENSE

Makefile (1438B)


      1 TARGET:=$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(shell uname -m)
      2 
      3 BIN:=sfinx
      4 
      5 SFINX_VERSION?=0.3.0
      6 export SFINX_VERSION
      7 
      8 FIND:=$(shell command -v gfind find)
      9 
     10 WATCH?=
     11 WATCH+=$(shell $(FIND) src -type f -name '*.c')
     12 WATCH+=$(shell $(FIND) src -type f -name '*.h')
     13 
     14 .PHONY: default
     15 default: build/${TARGET}/${BIN}
     16 
     17 build/${TARGET}/${BIN}: build/${TARGET} $(WATCH)
     18 	$(MAKE) --directory build/${TARGET} TARGET=${TARGET}
     19 
     20 build/${TARGET}: $(WATCH)
     21 	mkdir -p build/${TARGET}/src
     22 	cp -R src/.              build/${TARGET}/src/
     23 	cp -R target/common/.    build/${TARGET}/
     24 	cp -R target/${TARGET}/. build/${TARGET}/
     25 
     26 .PHONY: targets
     27 targets:
     28 	@ls -1 target | grep -v '^common$$'
     29 
     30 .PHONY: clean
     31 clean:
     32 	rm -rf build
     33 
     34 .PHONY: test
     35 test:
     36 	@$(MAKE) --no-print-directory --directory test run
     37 
     38 .PHONY: bench
     39 bench:
     40 	@$(MAKE) --no-print-directory --directory test bench BENCH_ARGS="$(BENCH_ARGS)"
     41 
     42 # Never let the catch-all try to rebuild the makefiles themselves
     43 Makefile: ;
     44 
     45 STDDOC?=stddoc
     46 
     47 .PHONY: docs
     48 docs: docs/api.md
     49 
     50 docs/api.md: src/sfinx.h
     51 	$(STDDOC) < src/sfinx.h > docs/api.md
     52 
     53 .PHONY: format
     54 format:
     55 	$(FIND) src/ -type f \( -name '*.c' -o -name '*.h' \) -exec clang-format -i {} +
     56 	$(FIND) test/ -type f \( -name '*.c' -o -name '*.h' \) -exec clang-format -i {} +
     57 
     58 # Forward any other goal verbatim into the assembled target tree
     59 .PHONY: FORCE
     60 FORCE:
     61 %: build/${TARGET} FORCE
     62 	$(MAKE) --directory build/${TARGET} TARGET=${TARGET} $@