1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2012 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or (at
8 // your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18 
19 #include <common/ac/assert.h>
20 
21 #include <aemakegen/process_data.h>
22 #include <aemakegen/process_item/libdir.h>
23 #include <aemakegen/target.h>
24 #include <aemakegen/util.h>
25 
26 
~process_item_libdir()27 process_item_libdir::~process_item_libdir()
28 {
29 }
30 
31 
process_item_libdir(target & a_tgt)32 process_item_libdir::process_item_libdir(target &a_tgt) :
33     process_item(a_tgt, &target::process_item_libdir)
34 {
35 }
36 
37 
38 process_item_libdir::pointer
create(target & a_tgt)39 process_item_libdir::create(target &a_tgt)
40 {
41     return pointer(new process_item_libdir(a_tgt));
42 }
43 
44 
45 bool
condition(const nstring & fn)46 process_item_libdir::condition(const nstring &fn)
47 {
48     return fn.starts_with("libdir/");
49 }
50 
51 
52 void
preprocess(const nstring & fn)53 process_item_libdir::preprocess(const nstring &fn)
54 {
55     assert(condition(fn));
56     data.set_seen_libdir();
57 
58     nstring stem = fn.trim_first_directory();
59     nstring dst = "$(libdir)/" + stem;
60     data.remember_install_libdir(dst);
61 
62     data.set_install_data_macro();
63 }
64 
65 
66 // vim: set ts=8 sw=4 et :
67