Update Makefile
This commit is contained in:
parent
d3526c4e13
commit
89b97deeff
29
Makefile
29
Makefile
@ -1,22 +1,25 @@
|
|||||||
NAME=main
|
NAME:=lat
|
||||||
|
|
||||||
SRCDIR=src
|
SRCDIR:=src
|
||||||
IDIR=include
|
IDIR:=include
|
||||||
ODIR=obj
|
ODIR:=obj
|
||||||
BINDIR=build
|
BINDIR:=build
|
||||||
|
|
||||||
CC=cc
|
CC:=cc
|
||||||
CFLAGS=-I$(IDIR) -Wall -Wextra -pedantic
|
CFLAGS:=-I$(IDIR) -Wall -Wextra -pedantic
|
||||||
LIB=
|
LIB:=
|
||||||
|
|
||||||
_DEPS=lib.h
|
DEPS:=$($(IDIR)/%.h)
|
||||||
DEPS=$(patsubst %,$(IDIR)/%,$(_DEPS))
|
|
||||||
|
|
||||||
_OBJ=$(NAME).o lib.o
|
#SRCS:=$(wildcard $(SRCDIR)/*.c)
|
||||||
OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ))
|
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)
|
$(CC) -c -o $@ $< $(CFLAGS) $(LIB)
|
||||||
|
|
||||||
$(NAME): $(OBJ)
|
$(NAME): $(OBJ)
|
||||||
|
Loading…
Reference in New Issue
Block a user