# This being the first target defined, it is the default that will be # built when you run "make". The standard "make" utility has built-in # rules that tell it how to build programs from source files, but not # for C++: # # https://pubs.opengroup.org/onlinepubs/9699919799/ # # Here we implement something similar for C++ programs contained in # .cc source files. This, we hope, ensures that this Makefile will # work with non-GNU implementations of Make. example: example.o # POSIX does not specify a default for this, so we try "c++" # because that's what GNU Make does. CXX ?= c++ LIBS ?= -lLfunction .SUFFIXES: .cc .o .cc.o: $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $< .o: $(CXX) $(LDFLAGS) $< $(LIBS) -o $@ .PHONY: clean clean: rm -f example.o example