-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (30 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# $Id$
#######################################################################################
## Project : asic-pinout-drawer
## Designer : Dmitry Murzinov ([email protected])
## Link : https://github.com/iDoka/asic-pinout-drawer
## Module : A PHP generator that drawing a IC-case with pinout assingment in SVG
## Description:
## Revision : $Rev
## Version : $GlobalRev$
## Date : $LastChangedDate$
## License : MIT
#######################################################################################
FILE=pinout
PNG_SCALE=2
PNG_DENSITY=$(shell echo 72*$(PNG_SCALE) | bc)
all:
@grep -v "====" $(FILE).adoc | grep -e "^|" | sed 's/^|//' | sed 's/[ ]*|[ ]*/|/g' > $(FILE).csv
@$(eval PIN_COUNT=$(shell cat $(FILE).csv | wc -l))
@echo "Amount of pins will be processed (from source AsciiDoc-table): $(PIN_COUNT)"
@php parse-csv.php $(FILE).csv > $(FILE).json
@php pinout-gen.php $(FILE).json > $(FILE).svg
@echo "Drawing done!"
png:
@convert -background none -antialias -density $(PNG_DENSITY) $(FILE).svg $(FILE).png
example: copy-example, all
copy-example: $(FILE).svg
@cp example/$(FILE).adoc .
clean:
@rm -rf $(FILE).{csv,json,svg,png}
.PHONY: all example copy-example clean $(FILE).adoc