public
Description: This is a space for projects that maybe did or didn't start at a Dojo session and the participants continued developing.
Homepage: http://groups.google.com/group/dojo_sp
Clone URL: git://github.com/dojosp/participant-s-projects.git
Thiago R. Colucci (author)
Tue Oct 27 17:20:52 -0700 2009
commit  3cf559ea489dfd77c8ec14b9cb137560acf8f79d
tree    b7381a6d0e5e7445d4dd48bcb2dc768c46410389
parent  157126dd4af306d6ab5fa63e00ced5f2d5bc9b1f
participant-s-projects / 48-einstein
name age message
..
file Darwin.mk Loading commit data...
file Makefile
file README
directory bin/
directory lib/
file objects.mk
directory scripts/
file sources.mk
directory src/
directory tests/
48-einstein/README
Dojo Unit v. 0.2
by Hugo Corbucci & Dojo participant's contributions

Description
-----------
This small project structure is a very simple C project structure compiled and run by Makefiles.
The 'src' folder should contain a code file (.c) with the name of your project (specified in the objects.mk file) and a 
corresponding header file (.h).
The 'tests' folder should contain a code and a header file named after your project with '_tests' at the end.
The 'lib' folder should contain any header file from non standart libraries your code (or tests) will use.


Known Issues
------------
So far, the library is only compilable on Mac OS X. Need to make Makefile parts for each operating system and add the 
correct library.


How to run
-----------
Write your code and tests in their specified files and then, from the same folder that contains this file, run:

'make' to compile the software and run the tests printing a default summary.
'make run' to run your software (only works if your code file has a main function).


Changing default names
----------------------
The 'objects.mk' file contains several of the default names used (such as source folder, binary output folder, library 
folder, etc...). You can change those if you really need to but I doubt you have a very good reason for that. It also 
contains information about your project, the compiler to use as well as flags. Feel free to adapt this to your needs.


Debug
------
This is currently NOT WORKING. gdb doesn't show the source code. But it should work like that:

If you wish to debug the generated program at any time, run 'make DEBUG=-g target' where target is what you type to 
generate the binary you want to debug. Then you should be able to run gdb on that binary.


Customizing compile process
---------------------------

If you have files that are not generated by the default Makefile, you can add them in the 'sources.mk' variable 
corresponding (C_SRCS for .c files, O_SRCS for .o, OBJ_SRCS for .obj, you should not change CODE_OBJS and TESTS_OBJS 
because those are essentials for Makefile to work correctly).