CC=gcc

modulePath=$(PWD)/../../

common_arg=-fplugin=melt -fno-inline -fplugin-arg-melt-module-path='$(modulePath)' -fplugin-arg-melt-source-path='$(modulePath)' -fplugin-arg-melt-extra=@$(modulePath)/talpo -O0 -Wall -fplugin-arg-melt-mode=talpo


all: clean test_simple_check_pragma test_simple_check_direct_arg test_simple_check_from_file


test_simple_check_pragma: test_pragma.c
	$(CC) $(common_arg) test_pragma.c -o test.o

test_simple_check_direct_arg: test.c
	$(CC) $(common_arg)  -fplugin-arg-melt-option=talpo-arg='(testFollowedBy "chroot" 1 "chdir" 1)' test.c -o test.o

test_simple_check_from_file: test.c
	$(CC) $(common_arg)  -fplugin-arg-melt-option=talpo-arg-file='option.melt' test.c -o test.o

test_simple_check_debug: test.c
	$(CC) $(common_arg) test.c -o test.o
clean: 
	rm -vf *.so
	rm -vf *.o
	rm -vf *.c.%0*

