diff options
author | Shav Kinderlehrer <[email protected]> | 2023-04-10 18:55:54 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-04-10 18:55:54 -0400 |
commit | 89b97deeffeceacd618b91d118b21bea55d58460 (patch) | |
tree | be979ddaf4a3062502f63bee357e52b98408a078 /Makefile | |
parent | d3526c4e13202b193587e54f903d51bf8e8af15f (diff) | |
download | lat-89b97deeffeceacd618b91d118b21bea55d58460.tar.gz lat-89b97deeffeceacd618b91d118b21bea55d58460.zip |
Update Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -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) |