#!/usr/bin/env python3
import os,sys
from subprocess import call
indir = sys.argv[1].rstrip('/')
outdir = sys.argv[2].rstrip('/')

if not os.path.exists(outdir):
    os.makedirs(outdir)
    
for fn in os.listdir(indir): 
    c = ' '.join(['gcc', '-o', outdir+'/'+fn.split('.')[0]+'.out' , indir+'/'+fn])
    call(c,shell=True)
