# PR port-vax/44155: exceptions thrown and caught inside one program.
# Works with NetBSD make and GNU make.  Try other levels: make OPT=-O0

CXX?=		c++
OPT?=		-O2
WARN=		-Wall -Wextra
FLAGS=		${OPT} -g ${WARN}

PROGS=		exc_internal exc_internal_static

all: ${PROGS}

exc_internal: exc_internal.cc
	${CXX} ${FLAGS} -o $@ exc_internal.cc

exc_internal_static: exc_internal.cc
	${CXX} ${FLAGS} -static -o $@ exc_internal.cc

run: all
	./exc_internal; echo "exit status $$?"
	./exc_internal_static; echo "exit status $$?"

clean:
	rm -f ${PROGS} *.core core

.PHONY: all run clean
