molehole/Makefile

33 lines
588 B
Makefile
Raw Permalink Normal View History

2024-07-23 21:48:28 +00:00
NAME=molehole
SRCDIR=src
OBJDIR=obj
BUILDDIR=build
SOURCES=$(shell find $(SRCDIR) -type f -name '*.c')
OBJSOURCES=$(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
CC=clang
CFLAGS=-Wall -Wextra -pedantic -O0 -g
LDFLAGS=-lncurses -lssl -lc
INCLUDEFLAGS=-Iinclude
VPATH=$(dir $(SOURCES))
$(BUILDDIR)/$(NAME): $(OBJSOURCES) | $(BUILDDIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) -c -o $@ $< $(CFLAGS) $(INCLUDEFLAGS)
$(BUILDDIR):
mkdir -p $(BUILDDIR)
$(OBJDIR):
mkdir -p $(OBJDIR)
.PHONY: clean
clean:
rm -rfv $(OBJDIR)
rm -rfv $(BUILDDIR)