Skip to content

Instantly share code, notes, and snippets.

@alex-pat
Created March 9, 2016 19:55
Show Gist options
  • Save alex-pat/ff488294fa60aae396ee to your computer and use it in GitHub Desktop.
Save alex-pat/ff488294fa60aae396ee to your computer and use it in GitHub Desktop.
'make' analog for tasm
#!/usr/bin/env python
# sudo ln -s mk.py /usr/local/bin/mk
## USAGE
## mk lab1
## mk clean lab1
from sys import argv, exit
from os import system
if len (argv) < 2 or len(argv[1]) == 0 :
print('Error')
exit()
if argv[1] == 'clean' :
if len(argv) < 3 :
print('Error')
exit()
system('rm -f {0}.EXE'.format(argv[2].upper()) )
exit()
target = argv[1]
command = ''' dosbox -c "mount c ." \
-c "c:" \
-c "tools\\tasm /z/zi/n {0}" \
-c "tools\\tlink /v/x {0}" \
-c "del {0}.obj" \
&
'''
system(command.format( target ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment