blind

suckless command-line video editing utility
git clone git://git.suckless.org/blind
Log | Files | Refs | README | LICENSE

Makefile (1949B)


      1 .POSIX:
      2 
      3 CONFIGFILE = config.mk
      4 include files.mk
      5 include $(CONFIGFILE)
      6 
      7 SH_SCRIPTS =\
      8 	blind-rotate-90\
      9 	blind-rotate-180\
     10 	blind-rotate-270
     11 
     12 KSH_SCRIPTS =\
     13 	blind-primary-key
     14 
     15 COMMON_OBJ =\
     16 	util.o\
     17 	stream.o
     18 
     19 HDR =\
     20 	arg.h\
     21 	common.h\
     22 	define-functions.h\
     23 	stream.h\
     24 	util.h\
     25 	util/to.h\
     26 	util/jobs.h\
     27 	util/emalloc.h\
     28 	util/eopen.h\
     29 	util/endian.h\
     30 	util/colour.h\
     31 	util/io.h\
     32 	util/efflush.h\
     33 	util/efunc.h\
     34 	util/eprintf.h\
     35 	util/fshut.h\
     36 	video-math.h
     37 
     38 MISCFILES =\
     39 	Makefile\
     40 	config.mk\
     41 	blind.mk\
     42 	rules.mk\
     43 	LICENSE\
     44 	README\
     45 	TODO\
     46 	src/generate-macros.c
     47 
     48 EXAMPLEFILES =\
     49 	inplace-flop/Makefile\
     50 	reverse/Makefile\
     51 	split/Makefile
     52 
     53 MAN7 =\
     54 	blind
     55 
     56 all: build/files.mk build/common-files.mk
     57 	@make -f blind.mk $@
     58 
     59 build/files.mk: files.mk
     60 	mkdir -p -- $(@D)
     61 	(	printf 'BIN =' && \
     62 		printf '\\\n\t%s' $(BIN) && \
     63 		printf '\n\nSRC =' && \
     64 		printf '\\\n\tsrc/%s' $(BIN:=.c) $(COMMON_OBJ:.o=.c) && \
     65 		printf '\n\nEXAMPLEDIRS =' && \
     66 		printf '\\\n\texamples/%s' $(EXAMPLEFILES) | sed 's|/[^/\\]*\(\\*\)$$|\1|' | uniq && \
     67 		printf '\n\nEXAMPLEFILES =' && \
     68 		printf '\\\n\texamples/%s' $(EXAMPLEFILES) && \
     69 		printf '\n\nMISCFILES =' && \
     70 		printf '\\\n\t%s' $(MISCFILES) && \
     71 		printf '\n\nSH_SCRIPTS =' && \
     72 		printf '\\\n\t%s' $(SH_SCRIPTS) && \
     73 		printf '\n\nKSH_SCRIPTS =' && \
     74 		printf '\\\n\t%s' $(KSH_SCRIPTS) && \
     75 		printf '\n\nMAN =' && \
     76 		printf '\\\n\tman1/%s.1' $(BIN) $(SH_SCRIPTS) $(KSH_SCRIPTS) && \
     77 		printf '\\\n\tman7/%s.7' $(MAN7) && \
     78 		printf '\n' \
     79 	) > $@.$$$$ && mv $@.$$$$ $@
     80 
     81 build/common-files.mk: Makefile
     82 	mkdir -p -- $(@D)
     83 	(	printf 'HDR =' && \
     84 		printf '\\\n\tsrc/%s' $(HDR) && \
     85 		printf '\n\nCOMMON_OBJ =' && \
     86 		printf '\\\n\t%s' $(COMMON_OBJ) && \
     87 		printf '\n' \
     88 	) > $@.$$$$ && mv $@.$$$$ $@
     89 
     90 clean:
     91 	-rm -rf -- $(BIN) build *.o *.a *.bo blind-mcb
     92 	-rm -rf -- blind-$(VERSION).tar.gz "blind-$(VERSION)"
     93 
     94 .DEFAULT:
     95 	@make build/files.mk build/common-files.mk
     96 	@make -f blind.mk $@
     97 
     98 .PHONY: all clean