Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ <h1>Posts</h1>
<a href="https://github.com/eXpOSNitc/user-contrib/blob/main/users/anandubajith/docker-based-setup-silc.md">
Docker based setup for SILC NIT-C</a>
</li>
<li >
<a href="https://github.com/eXpOSNitc/user-contrib/blob/main/users/shrn01/script-to-compile-spl.md">
Python Script for running all SPL files</a>
</li>
</ul>

</body>
Expand Down
19 changes: 19 additions & 0 deletions users/shrn01/compile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3

import os

# get all immediate subdirectories of /sql_progs directory
dir = [ '/' + x for x in next(os.walk(os.getcwd() + '/spl_progs'))[1]]

# add /sql_progs directory
dir.append('')

for i in dir:
print('\nin directory ' + os.getcwd() + '/spl_progs' + i)
l = os.listdir(os.getcwd() + '/spl_progs' + i)
for k in l:
if '.spl' in k:
print('\tcompiling '+ os.getcwd() + '/spl_progs'+ i + '/' + k)
os.system('./spl '+ os.getcwd() + '/spl_progs'+ i + '/' + k)

print("finished compiling")
15 changes: 15 additions & 0 deletions users/shrn01/script-to-compile-spl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Python Script to compile all SPL files in one go saving time

### What it does.

Having to compile all the kernel spl modules after each change can be a lot time consuming to do by hand. This script basically compiles all the spl files in one go.

### How to use.

Python3 is already pre-installed on many linux distros, if not install it.

Put the `compile.py` script in `myexpos/spl` folder.

Run `python3 compile.py` or `./compile.py` from `myexpos/spl` folder .

**Note** : This script only compiles SPL programs which are in the `myexpos/spl/spl_progs` directory and immediate subdirectories.