From: Justin Seyster Date: Wed, 7 Jul 2010 23:56:06 +0000 (-0400) Subject: Documentation for the new workspace feature. X-Git-Tag: release-v1.0~74^2~3 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=8f9f0a742ea00549cf0a86265f8e350d35169b67;p=interaspect.git Documentation for the new workspace feature. --- diff --git a/INSTALL b/INSTALL index 58e7d39..f934759 100644 --- a/INSTALL +++ b/INSTALL @@ -137,3 +137,32 @@ normally: # plug-ins, we recommend compiling with these CFLAGS to turn on # debugging support for the InterAspect library. make CFLAGS='-g -O0' + +-------- +4. Building an InterAspect Plug-in +--- + +The easiest way to get started writing InterAspect plug-ins is to use +the Makefile provided in the workspace/ directory. Write your plug-in +as a single C file and place it in the workspace/ directory. + +You can compile a plug-in named hello.c by typing: + +# Again, you only need the CFLAGS if you want debugging support. +make libhello.so CFLAGS='-g -O0' + +This pattern will work for any *.c file. + +-------- +5. Using an InterAspect Plug-in +--- + +Once you have compiled your plug-in into a .so file, you can tell GCC +to use it with the -fplugin option: + +$PLUGIN_BASE/install-plugin/bin/gcc -fplugin=path/to/libhello.so + -o instrumented-program file1.c file2.c + +All the other GCC options are the same as usual. Also, you do not +need to specify -fplugin for your linking step (if you have a separate +linking step). diff --git a/workspace/README b/workspace/README new file mode 100644 index 0000000..d21eb4a --- /dev/null +++ b/workspace/README @@ -0,0 +1,16 @@ +This workspace directory is intended as a convenient way to get +started writing InterAspect plug-ins. Just write your plug-in as a C +file in this directory and compile it using the included Makefile. +The Makefile has pattern rules that let it compile any *.c into a +lib*.so plug-in file. + +There is already a Hello World plug-in named hello.c. You can compile +it with the make command: + +make libhello.so + +Note that if you build InterAspect in another directory (separate from +the source directory), you have to specify the location of the +finished library to the Makefile. + +make LIB_INTERASPECT=$IA_BUILD_DIR/src/.libs/interaspect.a libhello.so