This commit is contained in:
tzyvoski
2022-05-21 20:48:10 +02:00
parent 27c4833987
commit dbab0cc0e5
+9 -4
View File
@@ -1,21 +1,26 @@
# Aux functions
rwildcard = $(foreach d, $(wildcard $(1:=/*)), $(call rwildcard ,$d, $2) $(filter $(subst *, %, $2), $d))
# Compiler
CXX = gcc CXX = gcc
CC = $(CROSS_COMPILE)$(CXX) CC = $(CROSS_COMPILE)$(CXX)
INCDIR = include # Compiler flags
CFLAGS = -O3 -Wall -Wextra -g -I $(INCDIR)/intf -I "src/intf" CFLAGS = -O3 -Wall -Wextra -g
LFLAGS = -lm LFLAGS = -lm
# Files and directories
SRCDIR = src SRCDIR = src
OBJDIR = temp OBJDIR = temp
BINDIR = build BINDIR = build
OUTFILE = noja OUTFILE = noja
rwildcard = $(foreach d, $(wildcard $(1:=/*)), $(call rwildcard ,$d, $2) $(filter $(subst *, %, $2), $d)) # Find all files
SRC = $(call rwildcard, $(SRCDIR), *.c) SRC = $(call rwildcard, $(SRCDIR), *.c)
OBJS = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC)) OBJS = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC))
# Compile everything to object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(OBJDIR)/%.o: $(SRCDIR)/%.c
@ echo $(shell tput setaf 3) [C] $(shell tput setaf 5) [SRC] $(shell tput setaf 7) $^ @ echo $(shell tput setaf 3) [C] $(shell tput setaf 5) [SRC] $(shell tput setaf 7) $^
@ mkdir -p $(@D) @ mkdir -p $(@D)