#!/usr/bin/make -f

BUILD_TREE:=../build-tree

check: $(BUILD_TREE)/cc-test
	$(MAKE) -f Makefile.wrapper $@
	$(MAKE) -f Makefile.includes $@

clean:
	rm -f $(BUILD_TREE)/cc-test
	$(MAKE) -f Makefile.wrapper $@
	$(MAKE) -f Makefile.includes $@

$(BUILD_TREE)/cc-test:
	# Check the stack protector and PIE options directly, just to have
	# a historical record in the build logs.
	$(CC) -Wall -fstack-protector hello.c -o $(BUILD_TREE)/cc-test || true
	$(BUILD_TREE)/cc-test || true
	$(CC) -Wall -fstack-protector-strong hello.c -o $(BUILD_TREE)/cc-test || true
	$(BUILD_TREE)/cc-test || true
	$(CC) -Wall -fPIE -pie hello.c -o $(BUILD_TREE)/cc-test || true
	$(BUILD_TREE)/cc-test || true
	$(BUILD_TREE)/cc-test || true

.PHONY: check clean
