Zachary Anderson avatar Zachary Anderson committed 339b8c6

Updated README and docs to reflect cmake build

Comments (0)

Files changed (3)

-Copyright (c) 2012, Zachary Anderson (zanderso@acm.org)
+Copyright (c) 2012,2013 Zachary Anderson (zanderso@acm.org)
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
 CIL is a frontend for C compilers. It takes C code as input, which can then be
 analyzed or instrumented, and then spits out C code, which can be passed to
 your favorite C compiler. This process can be automated such that your CIL-based
-frontend can be made to look like gcc, or whatever, and used directly in your
+front-end can be made to look like gcc, or whatever, and used directly in your
 build process. This tutorial creates such a frontend, and demonstrates, in
 tutorial form, some nifty things that might be done with it.
 
 Dependencies only for the theorem proving example (tut11.ml):
 . why3
 . theorem provers (e.g. alt-ergo)
-. pass --disable-tut11 to the configure script to disable tut11
+. pass -DBUILD_TUT11=true to cmake to include this example
 
 Dependencies only for the automated test generation example (tut15.ml):
 . Yices SMT solver (http://yices.csl.sri.com/)
 . ocamlyices (https://github.com/polazarus/ocamlyices)
-. pass --disable-tut15 to the configure script to disable tut15
+. pass -DBUILD_TUT15 to cmake to include this example
 
-After obtaining the code, enter the directory and do the following:
+Then, to obtain and build:
 
-$ ./configure [--disable-tut11] [--disable-tut15]
+$ hg clone https://bitbucket.org/zanderso/cil-template
+$ mkdir build
+$ cd build
+$ cmake [-DBUILD_TUT11=true] [-DBUILD_TUT15=true] ..
 $ make
 $ sudo make install
 
-Then, enter the /test directory and build the program like so:
+Then, enter the test directory and build a program like so:
 
 $ ciltutcc -o test1 test1.c
 $ ./test1
 
 5. Build cil-tutorial
 
-$ hg clone https://bitbucket.org/zanderso/cil-template
-$ cd cil-template
-$ ./configure --disable-tut11 --disable-tut15
-$ make; sudo make install
+As above
+
 
 6. Let me know if I've missed any steps =)
 
 3. Files:
 ---------
 
-Makefile.in - Edit the "MODULES =" line to add additional OCaml modules. Other
-parts of the Makefile can probably remain unchanged unless you need to do
-something weird.
+CMakeLists.txt - Add additional filenames to CILTUT_SRC on line 48 to add
+additional OCaml modules. Other parts of the Makefile can probably remain
+unchanged unless you need to do something weird.
 
 src/main.ml - Reads in a source file, calls into the various tutorial modules,
 spits out the result. Hopefully it is obvious where to add code to call into
 ciltut-include/ciltut.h - Various function and macro definitions needed for
 building ciltut-lib and the things in test/.
 
-ciltut-lib/ - The runtime library, build with CMake. The files in src/tut*.c
+ciltut-lib/ - The runtime library. The files in src/tut*.c
 go along with the corresponding .ml files. ciltut_libc.c has utility functions.
+To add new code to the runtime, add file names to the CMakeLists.txt file under
+the src/ directory in the obvious place.
 
 lib/Ciltut.pm - A perl script that sits in front of the actual compiler
 frontend. It is used for massaging the command line a bit. For example, it makes
 At the time this README file was written, this evaluates to:
 
 Zachary Anderson. A CIL Tutorial: Using CIL for Language Extensions and Program
-  Analysis, February 2012. http://www.inf.ethz.ch/~azachary.
+  Analysis, January 2013. http://www.inf.ethz.ch/~azachary.
 
 Or in bibtex format:
 
 @misc{ciltut,
   title = {A {CIL} Tutorial: Using {CIL} for Language Extensions and Program Analysis},
   author = {Zachary Anderson},
-  month = Sep,
-  year = 2012,
+  month = Jan,
+  year = 2013,
   note = {\url{http://www.inf.ethz.ch/~azachary/}},
 }

Binary file added.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.