Makefile: overhaul variables, std=gnu11 for now

This commit is contained in:
Andrew Scott 2024-09-06 11:03:59 -04:00
parent c73dfc2c00
commit 0747e78b15
Signed by: a
GPG key ID: 7CD5A5977E4931C1

View file

@ -1,22 +1,23 @@
CC = gcc
CFLAGS =
CFLAGS = -std=gnu11
CPPFLAGS = -Iinclude -MMD -MP
SRCDIR = src
SRCS = $(wildcard $(SRCDIR)/*.c)
OBJS = $(patsubst $(SRCDIR)/%.c,%.o,$(SRCS))
EXE = gc
SRCS := $(wildcard $(SRCDIR)/*.c)
OBJS := $(patsubst $(SRCDIR)/%.c,%.o,$(SRCS))
EXE = gc
DBDIR = debug
DBEXE = $(DBDIR)/$(EXE)
DBOBJS = $(addprefix $(DBDIR)/, $(OBJS))
DBCFLAGS = -g -O0 -DDEBUG
DBDIR = debug
DBEXE := $(DBDIR)/$(EXE)
DBOBJS := $(addprefix $(DBDIR)/, $(OBJS))
DBCFLAGS = -g -O0 -DDEBUG
REDIR = bin
REEXE = $(REDIR)/$(EXE)
REOBJS = $(addprefix $(REDIR)/, $(OBJS))
RECFLAGS = -O3 -Wall -Wextra -Wpedantic -Werror
REDIR = bin
REEXE := $(REDIR)/$(EXE)
REOBJS := $(addprefix $(REDIR)/, $(OBJS))
RECFLAGS = -O3 -Wall -Wextra -Wpedantic -Werror
.PHONY: all clean debug prep release
@ -43,3 +44,5 @@ prep:
clean:
rm -rf $(DBDIR) $(REDIR)
-include $(OBJ:.o=.d)