Update Makefile

This commit is contained in:
Shav Kinderlehrer 2023-04-10 18:55:54 -04:00
parent d3526c4e13
commit 89b97deeff

View File

@ -1,22 +1,25 @@
NAME=main
NAME:=lat
SRCDIR=src
IDIR=include
ODIR=obj
BINDIR=build
SRCDIR:=src
IDIR:=include
ODIR:=obj
BINDIR:=build
CC=cc
CFLAGS=-I$(IDIR) -Wall -Wextra -pedantic
LIB=
CC:=cc
CFLAGS:=-I$(IDIR) -Wall -Wextra -pedantic
LIB:=
_DEPS=lib.h
DEPS=$(patsubst %,$(IDIR)/%,$(_DEPS))
DEPS:=$($(IDIR)/%.h)
_OBJ=$(NAME).o lib.o
OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ))
#SRCS:=$(wildcard $(SRCDIR)/*.c)
SRCS=$(shell find . -name "*.c")
BASENAME:=$(shell basename $(SRCS))
VPATH=$(dir $(SRCS))
$(ODIR)/%.o: $(SRCDIR)/%.c $(DEPS)
OBJ=$(patsubst %.c,./$(ODIR)/%.o,$(BASENAME))
$(ODIR)/%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS) $(LIB)
$(NAME): $(OBJ)