CC=tcc SRC=src OBJ=obj SOURCES=$(wildcard $(SRC)/*.c) OBJECTS=$(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES)) BIN=main $(BIN): $(OBJECTS) $(CC) $(OBJECTS) -o $(BIN) $(OBJ)/%.o: $(SRC)/%.c $(CC) -c $< -o $@ clean: rm -r $(BIN) $(OBJ)/*.o