diff options
author | Shav Kinderlehrer <[email protected]> | 2023-04-09 13:42:44 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-04-09 13:42:44 -0400 |
commit | 97a99175f4f33282fb02e0ad75e02dbc30ace80c (patch) | |
tree | 46cdf8c7dc39f4dccf58590af850ddc2a0e951af /Makefile | |
download | lat-97a99175f4f33282fb02e0ad75e02dbc30ace80c.tar.gz lat-97a99175f4f33282fb02e0ad75e02dbc30ace80c.zip |
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7eb6e35 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +NAME=main + +SRCDIR=src +IDIR=include +ODIR=obj +BINDIR=build + +CC=cc +CFLAGS=-I$(IDIR) -Wall -Wextra -pedantic +LIB= + +_DEPS= +DEPS=$(patsubst %,$(IDIR)/%,$(_DEPS)) + +_OBJ=$(NAME).o +OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ)) + + +$(ODIR)/%.o: $(SRCDIR)/%.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) $(LIB) + +$(NAME): $(OBJ) + $(CC) -o $(BINDIR)/$@ $^ $(CFLAGS) $(LIB) + +.PHONY: prep +prep: + -@mkdir -p $(SRCDIR) + -@mkdir -p $(IDIR) + -@mkdir -p $(ODIR) + -@mkdir -p $(BINDIR) + @echo $(BINDIR)/ >> .gitignore + +.PHONY: clean +clean: + -rm -f $(ODIR)/* + -rm -f $(BINDIR)/* |