This is an incredibly simple question, but I\'m new to makefiles. I am trying to make a makefile that will compile two independent programs:
program1: gc
SRC = a.cpp b.cpp BIN = $(patsubst %.cpp,%,$(SRC)) all: $(BIN) clean: rm -f $(BIN) .PHONY: all clean
make all will do:
make all
c++ a.cpp -o a c++ b.cpp -o b
If you set CXX and CXXFLAGS variables make will use them.
CXX
CXXFLAGS
make