supercop

Basic CLI for supercop
git clone git://git.finwo.net/app/supercop
Log | Files | Refs | README | LICENSE

Makefile (1090B)


      1 TARGET:=linux-glibc-amd64
      2 
      3 BIN:=supercop
      4 
      5 VERSION?=v1.0.0
      6 
      7 .PHONY: default
      8 default: build/${TARGET}/${BIN}
      9 
     10 FIND:=$(shell command -v gfind find)
     11 
     12 WATCH?=
     13 WATCH+=$(shell $(FIND) src -type f -name '*.c')
     14 WATCH+=$(shell $(FIND) src -type f -name '*.h')
     15 
     16 build/${TARGET}/${BIN}: build/${TARGET} $(WATCH)
     17 	cd build/${TARGET} && dep install
     18 	$(MAKE) --directory build/${TARGET} TARGET=${TARGET} VERSION=${VERSION}
     19 
     20 build/${TARGET}: $(WATCH)
     21 	mkdir -p build/${TARGET}
     22 	cp -rT src/              build/${TARGET}/src
     23 	cp -rT man/              build/${TARGET}/man
     24 	cp -rT target/common/    build/${TARGET}
     25 	cp -rT target/${TARGET}/ build/${TARGET}
     26 
     27 .PHONY: targets
     28 targets:
     29 	@ls -1 target | grep -v '^common$$'
     30 
     31 README.md: ./man/supercop.1
     32 	pandoc $< --output=$@
     33 
     34 .PHONY: clean
     35 clean:
     36 	rm -rf build
     37 
     38 # Never let the catch-all try to rebuild the makefiles themselves
     39 Makefile: ;
     40 
     41 # Forward any other goal verbatim into the assembled target tree
     42 .PHONY: FORCE
     43 FORCE:
     44 %: build/${TARGET} FORCE
     45 	cd build/${TARGET} && dep install
     46 	$(MAKE) --directory build/${TARGET} TARGET=${TARGET} VERSION=${VERSION} $@