Skip to content

Commit

Permalink
remove unused variables in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
leonmavr committed Sep 27, 2024
1 parent 5d8441e commit bc75d76
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ CFLAGS = -g -I$(INC_DIR) -Wall
LDFLAGS = -lm
TEST_SRC = $(wildcard $(TEST_DIR)/*.c)
TARGET_SRC = $(wildcard $(TARGET_DIR)/*.c)
# Strip file path so each demo source gets a target,
# e.g. examples/01_demo.c -> 01_demo
TARGETS = $(patsubst $(TARGET_DIR)/%.c, %, $(TARGET_SRC))

# If `test` is passed as a cmd argument, extend flags to handle unit tests
ifeq ($(MAKECMDGOALS), test)
CFLAGS += -DRUN_UNIT_TESTS
SRC = $(wildcard $(SRC_DIR)/*.c)
TARGETS = $(patsubst $(TEST_DIR)/%.c,%,$(TEST_SRC))
TARGET_DIR = test
TARGET = $(TARGETS)
OBJECTS = $(SRC:%.c=%.o) $(TEST_SRC)
else
TARGET = $(TARGETS)
# Strip file path so each demo source gets a target,
# e.g. examples/01_demo.c -> 01_demo
TARGETS = $(patsubst $(TARGET_DIR)/%.c, %, $(TARGET_SRC))
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJECTS = $(SRC:%.c=%.o)
endif
Expand Down

0 comments on commit bc75d76

Please sign in to comment.