#!/usr/bin/gmake -f
ifeq (0,1)
require GNU make!
endif
#l223 TCP/IP v2.7 kapitola 4 obsahuje DNS
N4 = 48
 
L ?= 4
 
define N
$(shell while [ $${i:=1} -le $(N$1) ];do echo $$i;i=`expr $$i + 1`;done)
endef
define iota
$(shell while [ $${i:=$1} -le $2 ];do echo $$i;i=`expr $$i + 1`;done)
endef
define pngs
$(shell echo $1| sed -e 's,^\([0-9]\)$$,gifs/obraz\1,' -e 's,^\([0-9]\)\(.\)$$,gifs\1/obraz\2,')
endef
 
#obraz = $(addprefix obraz$L,$(shell while [ $${i:=1} -le $(N$L) ];do echo $$i;i=`expr $$i + 1`;done))
 obraz = $(addprefix $(call pngs,$L),$(call N,$L))
 
#vyvoj/ladeni:
g : ; @echo '$(call pngs,55)'
o : ; @echo '$(obraz)'
t : ; @echo '$(call iota,1,10)'
 
pngs : $(addsuffix .png,$(obraz))
 
gifs/obraz%.png gifs1/obraz%.png gifs2/obraz%.png :
	test -d $(dir $@) || mkdir $(dir $@)
	wget -O $@ http://www.earchiv.cz/l223/$@
 
#lze pouzit i pdftk, pouzijeme convert (ImageMagick)
lekce%.pdf : export L = $*
lekce%.pdf : ; $(MAKE) pngs L=$L; convert $(addsuffix .png,$(obraz)) $@
 
#1..11
pdfs : $(addsuffix .pdf,$(addprefix lekce,$(call iota,4,4)))
 
#Makefile.txt, clean:: distclean:: target
include ../common.mk
 
metadir = $(HOME)/bule.cz/data/meta
l223dir = $(metadir)/peterka/l223
install : pdfs
	test -d $(l223dir) || mkdir -p $(l223dir)
	cp lekce*.pdf $(l223dir)
 
 
FORCE : ;
 
 
peterka/l223/Makefile.txt · Last modified: 2014/12/29 22:10 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0