#!/usr/bin/env python3
-"""builds nsxlib VHD files into object files using ghdl
+"""builds nsxlib and other VHD files into object files using ghdl
"""
import os
import sys
-NSXLIB = "nsxlib"
+SRC = [('nsxlib', 'vhd'),
+ ('niolib', 'vhd'),
+ ('vst_src', 'vst')]
# make and change to obj dir
os.system("mkdir -p obj")
cwd = os.getcwd()
os.chdir("obj")
-# run ghdl -a on every nsxlib vhd file
-for fname in os.listdir("../%s" % NSXLIB):
- if not fname.endswith(".vhd"):
- continue
- print (fname)
- prefix = fname[:-4] # strip ".vhd"
- os.system("ghdl -a ../%s/%s" % (NSXLIB, fname))
+for srcdir, suffix in SRC:
+ # run ghdl -a on every vhd / vst file
+ for fname in os.listdir("../%s" % srcdir):
+ if not fname.endswith(".%s" % suffix):
+ continue
+ print (fname)
+ prefix = fname[:-4] # strip ".vhd"
+ os.system("ghdl -a -g --std=08 ../%s/%s" % (srcdir, fname))
# back to original dir
os.chdir(cwd)