Skip to content

Commit

Permalink
another foo commit for testing verifying
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGresset committed Dec 6, 2024
1 parent d89dd3b commit c422730
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
CC ?= gcc
CFLAGS ?= -Wall -g -Wextra -O3
LDLIBS ?= -lm
CC := gcc
CFLAGS := -Wall -g -Wextra -O3
LDLIBS := -lm
INCLUDE_PATH = ./include

TARGET =main

SRCDIR = src
OBJDIR = obj
BINDIR = bin
TEST_DIR = test
TEST_SRC = $(TEST_DIR)/test.c
TEST_BIN = $(TEST_DIR)/test

program := main
test-program := test-main

test-sources := $(wildcard TEST_DIR/*.c)
test-objects := $(test-sources:.c=.o)


SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCLUDE_PATH)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)

TEST_DIR = test
TEST_SRC = $(TEST_DIR)/test.c
TEST_BIN = $(TEST_DIR)/test


$(BINDIR)/$(TARGET): $(OBJECTS)

$(BINDIR)/$(program): $(OBJECTS)
mkdir -p $(BINDIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
@echo "Linking complete!"
Expand All @@ -33,10 +37,12 @@ doc:

test: $(TEST_BIN)

$(TEST_BIN): $(TEST_SRC)
$(CC) $(CFLAGS) -o $(TEST_BIN) $(TEST_SRC)
$(TEST_BIN): $(OBJECTS) $(TEST_SRC)
@ $(CC) $(CFLAGS) $(LDLIBS) $(OBJECTS) -o $(TEST_BIN) $(TEST_SRC)


.PHONY: clean
clean:
rm -rf obj/*.o
rm -f bin/arbres
rm -f test/test

0 comments on commit c422730

Please sign in to comment.