date/lutin_date.py

42 lines
861 B
Python
Raw Normal View History

2015-05-07 22:45:18 +02:00
#!/usr/bin/python
2015-05-08 22:36:21 +02:00
import lutin.module as module
import lutin.tools as tools
2015-05-07 22:45:18 +02:00
import datetime
def get_desc():
return "Date buid date of the program"
def create(target):
# module name is 'edn' and type binary.
myModule = module.Module(__file__, 'date', 'LIBRARY')
# add the file to compile:
myModule.add_src_file([
2015-09-14 21:11:04 +02:00
'date/date.cpp'
])
myModule.add_header_file([
'date/date.h'
])
2015-05-07 22:45:18 +02:00
now = datetime.datetime.now()
2015-05-08 22:36:21 +02:00
myModule.compile_flags('c++', [
2015-05-07 22:45:18 +02:00
'-Wno-write-strings',
'-Wall',
"-DBUILD_DAY=\""+str(now.day)+"\"",
"-DBUILD_MONTH=\""+str(now.month)+"\"",
"-DBUILD_YEAR=\""+str(now.year)+"\"",
"-DBUILD_HOUR=\""+str(now.hour)+"\"",
"-DBUILD_MINUTE=\""+str(now.minute)+"\"",
"-DBUILD_SECOND=\""+str(now.second)+"\""])
2015-09-14 21:11:04 +02:00
myModule.add_path(tools.get_current_path(__file__))
2015-05-07 22:45:18 +02:00
# add the currrent module at the
return myModule