diff options
| -rw-r--r-- | pcb/meson.build | 8 | ||||
| -rwxr-xr-x | web/content/copy.py | 9 | ||||
| -rw-r--r-- | web/content/meson.build | 24 | ||||
| -rw-r--r-- | web/layouts/home.html | 4 | ||||
| -rw-r--r-- | web/meson.build | 4 | 
5 files changed, 45 insertions, 4 deletions
diff --git a/pcb/meson.build b/pcb/meson.build index cd45a48..d74f8c3 100644 --- a/pcb/meson.build +++ b/pcb/meson.build @@ -7,6 +7,7 @@ schematic_files = [    'processor.kicad_sch',  ] +schematic_pdf = meson.current_build_dir() / 'schematic.pdf'  schematic = custom_target('schematic',    output: ['schematic.pdf'],    command: [ @@ -14,13 +15,14 @@ schematic = custom_target('schematic',      'sch',      'export',      'pdf', -    '--output', meson.current_build_dir() / 'schematic.pdf', +    '--output', schematic_pdf,      meson.current_source_dir() / 'iot-contact.kicad_sch',    ],    depend_files: schematic_files,    build_by_default: true,  ) +bom_csv = meson.current_build_dir() / 'bill-of-materials.csv'  bom = custom_target('bom',    output: ['bill-of-materials.csv'],    command: [ @@ -30,9 +32,11 @@ bom = custom_target('bom',      'bom',      '--fields',      'Reference,Description,Value,Footprint,Manufacturer,MPN,Datasheet', -    '--output', meson.current_build_dir() / 'bill-of-materials.csv', +    '--output', bom_csv,      meson.current_source_dir() / 'iot-contact.kicad_sch',    ],    depend_files: schematic_files,    build_by_default: true,  ) + +pcb = meson.current_build_dir() diff --git a/web/content/copy.py b/web/content/copy.py new file mode 100755 index 0000000..0b06e6d --- /dev/null +++ b/web/content/copy.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + + +import shutil +import sys + + +print(f"Copying {sys.argv[1]} to {sys.argv[2]}") +shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/web/content/meson.build b/web/content/meson.build index 75d3120..5046982 100644 --- a/web/content/meson.build +++ b/web/content/meson.build @@ -3,3 +3,27 @@ configure_file(    output: 'simple.css',    copy: true,  ) + +schematic_web = custom_target('schematic_web', +  output: ['schematic.pdf'], +  command: [ +    'copy.py', +    schematic_pdf, +    meson.current_build_dir() / 'schematic.pdf' +  ], +  depends: [ +    schematic, +  ], +) + +bom_web = custom_target('bom_web', +  output: ['bill-of-materials.csv'], +  command: [ +    'copy.py', +    bom_csv, +    meson.current_build_dir() / 'bill-of-materials.csv' +  ], +  depends: [ +    bom, +  ], +) diff --git a/web/layouts/home.html b/web/layouts/home.html index 5425ac9..dcd4a66 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -1,3 +1,7 @@  {{- define "main" -}}  <h1>{{ .Site.Title }}</h1> +<ul> +	<li><a href="bill-of-materials.csv">bill-of-materials.csv</a></li> +	<li><a href="schematic.pdf">schematic.pdf</a></li> +</ul>  {{- end -}} diff --git a/web/meson.build b/web/meson.build index 1e8989c..1c64394 100644 --- a/web/meson.build +++ b/web/meson.build @@ -14,8 +14,8 @@ website = custom_target('website',      'layouts/home.html',    ],    depends: [ -    schematic, -    bom, +    schematic_web, +    bom_web,    ],    build_by_default: true,  )  | 
