I'm trying to make so that the *.o files are kept in /bin however after running it, the *.o files are not kept.
my file systems is as follows:
> bin
> src
*.cpp
> headers
*.h
makefile
.
CC := g++
CFLAGS := -Isrc/headers
NAME := run
SRC := src/
HSRC := $(SRC)/headers/
OBJ := bin/
SOURCES := $(wildcard $(SRC)*.cpp)
DEPS = $(wildcard $(HSRC)*.h)
OBJECTS := $(patsubst $(SRC)*.cpp,$(OBJ)*.o,$(SOURCES))
$(OBJ)/%.o: %.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(NAME): $(OBJECTS)
$(CC) -o $@ $^ $(CFLAGS)
.PHONY: clean
clean:
rm -f $(NAME) $(OBJ)/*.o *~ core $(INCDIR)/*~