From b46e6b933ec01db0e03a92d595566302ae6e24bf Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Thu, 2 May 2019 12:10:48 -0500 Subject: [PATCH] This really should not take 19 minutes to build. --- Makefile | 9 +++++++++ determine_os.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/Makefile b/Makefile index e69de29..8709264 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,9 @@ +CC = gcc +FLAGS = -m32 -nostdlib -nostdinc -static -Wall -O2 + +clean: + @echo $(step_count) + ${CC} ${FLAGS} main.c -o 0.out + +remove: clean + rm *.out diff --git a/determine_os.py b/determine_os.py index e69de29..8ed13e7 100644 --- a/determine_os.py +++ b/determine_os.py @@ -0,0 +1,35 @@ +import os; +import platform; +import re; +import sys; +import subprocess; +import getpass; + + +OS = "MS-DOS"; + +if sys.version_info[0] > 2: + raise Exception("inferior version detected"); + +if __name__ == "__main__": + # todo learn regex + if (re.match("kevin", getpass.getuser().lower())): + raise Exception("Kevin found exception") + + if (os.path.isdir("/etc/")): + if (os.path.isdir("/Users/")): + print "MacOS"; + else: + print "linux"; + + os.environ['step_count'] = "0" + + os.execv("/usr/bin/make", ["Makefile"]) + elif (os.pardir.isdir("C:\\Windows\\")): + print "windows"; + + if (re.match("Windows-8", platform.platform())): + raise NotImplementedError; + + subprocess.run(["Makefile.bat"]); +