Makefiles
This commit is contained in:
parent
79472d8999
commit
97d992c651
|
@ -11,7 +11,7 @@ _OBJ=$(SRC:.c=.o)
|
|||
OBJ=$(patsubst %,$(OBJDIR)/%,$(_OBJ))
|
||||
DEPS=$(patsubst %,$(INCDIR)/%,$(HEADERS))
|
||||
|
||||
.PHONY: clean install uninstall fclean all re
|
||||
.PHONY: clean install uninstall fclean all re makedirs
|
||||
|
||||
all: $(BUILDDIR)/$(NAME)
|
||||
|
||||
|
@ -20,7 +20,7 @@ $(BUILDDIR)/$(NAME): $(OBJ)
|
|||
|
||||
$(OBJDIR)/%.o: %.c $(DEPS)
|
||||
norminette $<
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
clean:
|
||||
$(RM) $(wildcard $(OBJ))
|
||||
|
|
|
@ -6,19 +6,19 @@ INCDIR=include
|
|||
OBJDIR=obj
|
||||
BUILDDIR=build
|
||||
DIRS=
|
||||
DIRS+=${INCDIR}
|
||||
DIRS+=${OBJDIR}
|
||||
DIRS+=${BUILDDIR}
|
||||
DIRS+=$(INCDIR)
|
||||
DIRS+=$(OBJDIR)
|
||||
DIRS+=$(BUILDDIR)
|
||||
|
||||
# includes
|
||||
INCS=-I${INCDIR}
|
||||
INCS=-I$(INCDIR)
|
||||
|
||||
# flags
|
||||
CFLAGS=
|
||||
CFLAGS+=-Wall
|
||||
CFLAGS+=-Wextra
|
||||
#CFLAGS+=-Werror
|
||||
CFLAGS+=${INCS}
|
||||
CFLAGS+=$(INCS)
|
||||
LDFLAGS=
|
||||
|
||||
# compiler and linker
|
||||
|
@ -30,5 +30,3 @@ RMDIR=/bin/rmdir --ignore-fail-on-non-empty
|
|||
MKDIR=/bin/mkdir -p
|
||||
CP=/bin/cp -f
|
||||
CHMOD=/bin/chmod
|
||||
|
||||
$(shell mkdir -p $(DIRS))
|
||||
|
|
Loading…
Reference in New Issue