date/lutin_date.py

49 lines
1.0 KiB
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
2015-10-14 21:21:03 +02:00
def get_type():
return "LIBRARY"
2015-05-07 22:45:18 +02:00
def get_desc():
return "Date buid date of the program"
2015-10-14 21:21:03 +02:00
def get_licence():
return "APACHE-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
def get_version():
return [0,1]
2015-05-07 22:45:18 +02:00
2015-10-14 21:21:03 +02:00
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
2015-09-24 21:44:04 +02:00
my_module.add_src_file([
2015-09-14 21:11:04 +02:00
'date/date.cpp'
])
2015-09-24 21:44:04 +02:00
my_module.add_header_file([
2015-09-14 21:11:04 +02:00
'date/date.h'
])
2015-05-07 22:45:18 +02:00
now = datetime.datetime.now()
2015-09-24 21:44:04 +02:00
my_module.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-24 21:44:04 +02:00
my_module.add_path(tools.get_current_path(__file__))
return my_module
2015-05-07 22:45:18 +02:00