Makefile more thorough + better organization

This commit is contained in:
cdricms
2023-12-27 16:35:00 +01:00
parent 66c434a799
commit 5732856355
8 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ SRCDIR = src
BUILDDIR = build BUILDDIR = build
TARGET = main TARGET = main
SOURCES = $(wildcard $(SRCDIR)/*.c) SOURCES = $(wildcard $(SRCDIR)/**/*.c $(SRCDIR)/*.c)
OBJECTS = $(patsubst $(SRCDIR)/%.c, $(BUILDDIR)/%.o, $(SOURCES)) OBJECTS = $(patsubst $(SRCDIR)/%.c, $(BUILDDIR)/%.o, $(SOURCES))
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
@@ -23,7 +23,7 @@ $(EXECUTABLE): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(CC) $(CFLAGS) -o $@ $^
$(BUILDDIR)/%.o: $(SRCDIR)/%.c $(BUILDDIR)/%.o: $(SRCDIR)/%.c
$(MKDIR) $(BUILDDIR) @$(MKDIR) -p $(@D)
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
clean: clean:

View File

@@ -1,8 +1,8 @@
#ifndef __ENGINE_HEADER #ifndef __ENGINE_HEADER
#define __ENGINE_HEADER #define __ENGINE_HEADER
#include "board.h" #include "engine/board.h"
#include "common.h" #include "engine/common.h"
#include "fen.h" #include "engine/fen.h"
#endif // !__ENGINE_HEADER #endif // !__ENGINE_HEADER