File: map_plugins.sh

package info (click to toggle)
pcb-rnd 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 29,260 kB
  • sloc: ansic: 198,059; sh: 5,767; yacc: 5,568; makefile: 2,519; awk: 1,737; lex: 1,073; python: 519; lisp: 169; tcl: 67; xml: 40; perl: 34; ruby: 5
file content (58 lines) | stat: -rwxr-xr-x 1,740 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

# Run this script after changing or adding .pup files.
# WARNING: this script requires a fair amount of tools - it is intended to
#          run on developers' machines, not on users'

export LANG=C
PUPLUG=../src_3rd/puplug/util/puplug


# generate scconfig's 3 state plugin list
$PUPLUG findpups . '%$class$|%N|%3|%A|%$short$\n' | sed '
s/^lib/1|lib/
s/^feature/2|feature/
s/^fp/3|fp/
s/^import/4|import/
s/^export/5|export/
s/^io/6|io/
s/^hid/7|hid/
' | sort | awk -F "[|]" '
BEGIN {
	HDR["lib"] = "Library plugins"
	HDR["feature"] = "Feature plugins"
	HDR["fp"] = "Footprint backends"
	HDR["import"] = "Import plugins"
	HDR["export"] = "Export plugins"
	HDR["io"] = "IO plugins (file formats)"
	HDR["hid"] = "HID plugins"
	print "/******************************************************************************"
	print " Auto-generated by trunk/src_plugins/map_plugins.sh - do NOT edit,"
	print " run make map_plugins in trunk/src/ - to change any of the data below,"
	print " edit trunk/src_plugins/PLUGIN/PLUGIN.pup"
	print "******************************************************************************/"
}

function q(s) { return "\"" s "\"," }

($2 != last) {
	print "\nplugin_header(\"\\n" HDR[$2] ":\\n\")"
	last = $2
}

{
	if ($4 == "")
		print "Error: invalid default in plugin: " $3 > "/dev/stderr"
	printf("plugin_def(%-20s%-35s%-10s%s)\n", q($3), q($6), $4 "," , $5)
}

END { print "\n" }

' > ../scconfig/plugins.h

$PUPLUG findpups . "" 'plugin_dep("%N", "%m")\n' | sort >> ../scconfig/plugins.h


# Generate the plugin list
echo "# List of all plugins - generated by make map_plugins - do NOT edit" > plugins_ALL.tmpasm
$PUPLUG findpups . "include {../src_plugins/%D/Plug.tmpasm}\n" | sort >> plugins_ALL.tmpasm