+++ /dev/null
-# See README in this directory for more information about this
-# Makefile.
-
-CC=gcc
-CFLAGS=-Wall -Werror -O2
-
-INCLUDE=-I../src
-LIB_INTERASPECT=../src/.libs/libinteraspect.a
-
-all :
- @echo Use \"make libhello.so\" to compile a plug-in named hello.c.
- @echo See README in this directory for more information.
-
-clean :
- -rm *.o lib*.so.1.0.0 lib*.so 2> /dev/null
-
-$(LIB_INTERASPECT) :
- @echo Cannot find libinteraspect.a.
- @echo Make sure InterAspect is compiled.
- @echo You may need to check the README file to see how to pass the
- @echo location of libinteraspect.a to this Makefile.
- @false
-
-%.o : %.c
- gcc $(CFLAGS) $(INCLUDE) -fPIC -c -o $@ $<
-
-lib%.so : %.o $(LIB_INTERASPECT)
- gcc -shared -Wl,-soname,lib$*.so.1 -o lib$*.so $*.o $(LIB_INTERASPECT)
-
-.PHONY : all clean
--- /dev/null
+# See README in this directory for more information about this
+# Makefile.
+
+CC=gcc
+CFLAGS=-Wall -Werror -O2
+
+INCLUDE=@top_srcdir@/src
+LIB_INTERASPECT=../src/.libs/libinteraspect.a
+
+all :
+ @echo Use \"make libhello.so\" to compile a plug-in named hello.c.
+ @echo See README in this directory for more information.
+
+clean :
+ -rm *.o lib*.so.1.0.0 lib*.so 2> /dev/null
+
+$(LIB_INTERASPECT) :
+ @echo Cannot find libinteraspect.a.
+ @echo Make sure InterAspect is compiled.
+ @echo You can manually specify the location of libinteraspect.a
+ @echo by setting the LIB_INTERASPECT variable.
+ @false
+
+$(INCLUDE)/aop.h :
+ @echo Cannot find aop.h.
+ @echo If you moved this Makefile to outside your build directory, you
+ @echo will need to manually specify the location of the InterAspect src
+ @echo directory by setting the INCLUDE variable.
+ @false
+
+%.o : %.c $(INCLUDE)/aop.h
+ $(CC) $(CFLAGS) -I$(INCLUDE) -fPIC -c -o $@ $<
+
+lib%.so : %.o $(LIB_INTERASPECT)
+ $(CC) -shared -Wl,-soname,lib$*.so.1 -o lib$*.so $*.o $(LIB_INTERASPECT)
+
+.PHONY : all clean
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