mirror of
https://github.com/Soccera1/init.git
synced 2026-02-04 04:23:40 +01:00
Create Makefile
This commit is contained in:
parent
2ed22d1dc5
commit
2df3636b6a
1 changed files with 29 additions and 0 deletions
29
Makefile
Normal file
29
Makefile
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Isrc
|
||||
BIN_DIR = bin
|
||||
SRC_DIR = src
|
||||
|
||||
TARGETS = $(BIN_DIR)/main $(BIN_DIR)/solver
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
$(BIN_DIR)/main: $(SRC_DIR)/main.c $(SRC_DIR)/config.h | $(BIN_DIR)
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
$(BIN_DIR)/solver: $(SRC_DIR)/solver.c $(SRC_DIR)/config.h | $(BIN_DIR)
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
$(BIN_DIR):
|
||||
mkdir -p $(BIN_DIR)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGETS)
|
||||
rmdir $(BIN_DIR) 2>/dev/null || true
|
||||
|
||||
test: all
|
||||
@echo "Testing solver..."
|
||||
$(BIN_DIR)/solver 1
|
||||
$(BIN_DIR)/solver 3
|
||||
@echo "Tests complete."
|
||||
|
||||
.PHONY: all clean test
|
||||
Loading…
Add table
Reference in a new issue