1 |
This week I've started working on a makefile parser so that I can figure out |
2 |
additional include paths and which files to scan for includes. And if there |
3 |
are any extra include paths. |
4 |
|
5 |
This will hopefully solve some of the problems that I've had so far with |
6 |
figuring out if includes really are local or global as you can use |
7 |
#include <file>/"file" to include "local" files that comes with the source |
8 |
code. Right now "<file>" includes are always treated as global includes and |
9 |
"file" includes are treated as global ones if the file is not found. |
10 |
|
11 |
This has it's problems so I'll revisit the local/global include "detection" |
12 |
when I have more information about the build process. |
13 |
|
14 |
After the makefile parser is done I should be able to generate a simple |
15 |
ebuild by looking at makefiles, scan the files that are to be compiled for |
16 |
includes and link the includes to the appropriate dependecy. |
17 |
If all goes well I should be able to generate a simple ebuild for the program |
18 |
"doneyet" (http://code.google.com/p/doneyet/) quite soon. |
19 |
|
20 |
Other than that I realised that I needed to rework my milestones that I set |
21 |
up before I started programing. |
22 |
The problem was that because I haven't done anything like this before I |
23 |
accidently created milestones that where quite late in the timeline and had |
24 |
to be done before I could complete the ones before them. |
25 |
So I have with the help of my mentor rewritten them. These are the new ones: |
26 |
|
27 |
April 25 - May 23 |
28 |
1: The program is able to parse file structure and file contents of projects. |
29 |
May 24 - Jun 1 |
30 |
2: Be able to parse .c/.cpp/.h files for includes |
31 |
Jun 2 - Jun 16 |
32 |
3: Be able to generate a simple ebuild for "make && make install" projects. |
33 |
If there is extra time work on handeling configure files. |
34 |
Jun 17 - Jun 27 |
35 |
4: Generate ebuilds for "./configure" projects. If there is extra time work |
36 |
on autogen/autotool projects |
37 |
Jun 28 - July 5 |
38 |
5: Add missing features and clean up code. |
39 |
July 6 - July 13 |
40 |
6: handle autoconf/autogen/autotools |
41 |
July 14 - July 28 |
42 |
7: Be able to figure out deps that is not installed on the system. |
43 |
July 29 - Aug 6 |
44 |
9: Bugfixing and code cleanup |
45 |
Aug 7 - Aug 15 |
46 |
10: Try to support cmake/scons projects |
47 |
|
48 |
Milestones 1 and 2 are done. |
49 |
So right now I can "point" the program to a directory and it scan all files |
50 |
it finds with the supplied filetyp and returns a list with local,global and |
51 |
ifdef includes. |
52 |
|
53 |
Now when I've moved on to makefiles I'm really glad that I decided to |
54 |
"pimp out" my .vimrc file. I'm quite new to all of this (parsing, makefiles) |
55 |
so it really helped out that my current vim config shows tabs and spaces as |
56 |
special unicode charaters. That and thanks to the vim highlighting I should |
57 |
see where I should ignore tabs and when I should not. So even if I didn't |
58 |
know the makefile syntax I could quite quickly figure out how it worked. |
59 |
|
60 |
Right now I'm trying to figure out how I should figure out and store the |
61 |
files that are to be compiled. As you in most cases just type "make" when you |
62 |
want to build something I'm thinking about just getting the files from the |
63 |
first make target in the make files. But I'm not sure how I should store the |
64 |
information. In the end I'm only interested in the dependecies of the *.o |
65 |
files. Which in most cases is .c/.cpp/.h files. |
66 |
|
67 |
I were thinking about having it like this: |
68 |
maketarget → exefile → ofile1 ofile2 ofile3 |
69 |
| | | |
70 |
cfile1 cfile2 cfile3 |
71 |
| | | |
72 |
hfile1 hfile2 hfile3 |
73 |
|
74 |
And then when the parser is done take the *.o files and add the sourcefiles |
75 |
that they depend on them to the list of files to scan for includes so that |
76 |
files that will not be used doesn't add "ghost" dependecies. |