-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBensonGcc
More file actions
64 lines (50 loc) · 1.51 KB
/
BensonGcc
File metadata and controls
64 lines (50 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python3
import os
import sys
#VARS
extrastuff = "";
extralib = "";
selectname = "";
moretoimport = 1;
# catch the argument,if no argument if passed, there is nothing to compile
# so it will exit
nbOfArgs = (sys.argv)
#exit if no argumnt is passed
if len(nbOfArgs) <= 1:
print("\nPlease enter at least 1 c program to compile\n")
sys.exit();
word1 = sys.argv[1]
os.system("clear")
print("we will compile your source code called -->\t " + word1[:-2])
#new name
uwant2name = input("Name the program other than " + word1[:-2] + " : y/n [n] ")
if uwant2name == "y":
selectname = input("Type the new name : \t\t\t")
extrastuff += " -o " + selectname
else:
extrastuff += " -o " + word1[:-2]
#EXTRA LIB
uwantextra = input("Extra Stuff : y/n [n]? \t\t")
if uwantextra == "y":
while moretoimport == 1:
if uwantextra == "y" or uwantextra == "":
print("\nWhat are we adding ? \t\t ")
extralib = input(" 1 -lncurses \n 2 -lform \n 3 -lpanel \n 4 -lmenu \n:")
if extralib == "1":
extrastuff += " -lncurses"
if extralib == "2":
extrastuff += " -lform"
if extralib == "3":
extrastuff += " -lpanel"
if extralib == "4":
extrastuff += " -lmenu"
more = input("put more stuff ? y/n [n]")
if more == "n" or more == "":
moretoimport = 0
print("\n\nIf you want to do the compiling by youself use this : " + "\ngcc " + word1 + extrastuff)
print("\n\n\n")
#GO
if extrastuff == "":
os.system("gcc " + word1)
else:
os.system("gcc " + word1 + extrastuff)