I've made a makefile to compile program calc.cpp:
SRCS=calc.cpp
OBJS=$(subst .cpp,.o,$(SRCS))
FLGS=-std=c++17
all: calc clean
calc:
g++ $(SRCS) $(FLGS) -o $(OBJS)
./calc.o
clean:
rm -f $(OBJS)
However, I'm getting some strange errors:
- when I
make all, it only printsrm -f calc.o - if I remove
cleansection fromall, it printsmake: Nothing to be done for 'all'. - when I
make calc, it printsmake: 'calc' is up to date.
What is going on here, and why does make calc not compile my code?