-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkshow.py
61 lines (47 loc) · 1.88 KB
/
mkshow.py
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
#! /usr/bin/env python
def printCategory( category, items, isnested = False ):
if isnested:
print '\techo \'++++ {:12s} ++++\'; \\'.format(category)
else:
print '\t@echo \'++++ {:12s} ++++\''.format(category)
for item in items:
if isnested:
print "\tif [ \"$(strip $({:s}))\" != \"\" ]; then \\".format(item)
else:
print "\t@if [ \"$(strip $({:s}))\" != \"\" ]; then \\".format(item)
print "\techo '++ {:17s} : $({:s})'; \\".format(item,item)
if isnested:
print "\tfi; \\"
else:
print "\tfi"
def printLanguage( language, ext ):
vars = []
for var in ["BINS", "ALLSRC", "BINSRC", "SRC", \
"TARGETS", "INST_FILES", "INST_TARGETS", \
"COMPILE", "LINK", "DEPEND", \
"CFLAGS", "MY_CFLAGS", "LDFLAGS", "MY_LDFLAGS", \
"SRC.objs", "OBJS"]:
# "SRCSUFX", "HDRSUFX"] :
vars.append( var+"."+ext )
print "\t@if [ \"$(strip $({:s}))\" != \"\" ]; then \\".format("ALLSRC."+ext)
printCategory( language, vars, True )
print "\tfi"
##########
## main ##
##########
print "# Show variables (for debug use only.)"
print "# This file is generated by mkshow.py script."
print "# Only variables which have a value are shown."
print "show: "
printCategory ("General", ["LAMAKE", "BINARIES", "LIBNAME", "LIBTYPE", \
"SRCDIRS", "INCDIRS", "BINDIR", "LIBDIR", \
"OBJDIR", "TESTDIR", "EXAMPLEDIR", "DOCDIR", \
"DEP_OPT", "AR", "TEE", "CWD", \
"UENV", "SET_UENV", "RM_SLOTS", "SLOTS" ])
printLanguage ("C" , "c" )
printLanguage ("C++" , "cc" )
printLanguage ("FreeBasic" , "bas" )
printLanguage ("Assembly" , "asm")
printLanguage ("PRU asm" , "pasm" )
printLanguage ("Device Tree", "dt" )
printLanguage ("ALL" , "all")