You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcc-explorer/c-preload/Makefile

20 lines
759 B
Makefile

all: libpreload.so
libpreload.so: preload.c
$(CC) -std=c99 -shared -O1 -fPIC $^ -o $@ -ldl
.PHONY: test clean
test: libpreload.so
-@rm -f /tmp/allowed
cat tests/testfile | ./compiler-wrapper g++ -std=c++0x -S -o /tmp/allowed -x c++ -
@if [ ! -s /tmp/allowed ]; then echo "/tmp/allowed should exist"; false; fi
-@rm -f /tmp/allowed
cat tests/bad-includes | ./compiler-wrapper g++ -std=c++0x -S -o /tmp/allowed -x c++ - 2>&1 | grep 'Denying'
@if [ -s /tmp/allowed ]; then echo "/tmp/allowed should not exist"; false; fi
-@rm -f not-allowed
cat tests/testfile | ./compiler-wrapper g++ -std=c++0x -S -o not-allowed -x c++ - 2>&1 | grep 'Denying'
@if [ -e not-allowed ]; then echo "not-allowed should not exist"; false; fi
clean:
rm -f libpreload.so