... VPATH = $(MYSOURCES) : $(MYTOOLS) ... #Linux + Freebsd: use the magic configurator "ExtUtils::Embed" PERLCC=`perl -MExtUtils::Embed -e perl_inc` PERLLD=`perl -MExtUtils::Embed -e ldopts -- -std` PLSTATIC= # -static # if static libperl.a, set this to -static, otherwise to (none) CXXFLAGS=-O3 COMPILE.cxx=$(CXX) $(CFLAGS) $(CXXFLAGS) $(PERLCC) -I$(MYHEADERS) -c .cxx.o: $(COMPILE.cxx) $< -o $(@F) $(EXE): $(F_MYSOURCE) $(F_MYTOOLS) Makefile $(CXX) -o $@ $(F_MYSOURCE) $(F_MYTOOLS) $(PERLLD) $(PLSTATIC) -lstdc++ -s ...