This commit is contained in:
Timo Schmidt 2023-03-26 07:51:24 +02:00
parent 1458dfab52
commit 64ca327e50
1 changed files with 41 additions and 0 deletions

41
ex00/Makefile Normal file
View File

@ -0,0 +1,41 @@
# Makefile for rush01
include config.mk
NAME?=rush-01
SRC=gen_util.c handle_input.c handle_mem.c main.c print_array.c
HEADERS=
_OBJ=$(SRC:.c=.o)
OBJ=$(patsubst %,$(OBJDIR)/%,$(_OBJ))
DEPS=$(patsubst %,$(INCDIR)/%,$(HEADERS))
.PHONY: clean install uninstall fclean all re
all: $(BUILDDIR)/$(NAME)
$(BUILDDIR)/$(NAME): $(OBJ)
$(CC) $(LDFLAGS) -o $@ $^
$(OBJDIR)/%.o: %.c $(DEPS)
norminette $<
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(wildcard $(OBJDIR)/$(OBJ))
$(RM) $(wildcard $(INCDIR)/*~)
$(RM) $(wildcard *~)
fclean: clean
$(RM) $(wildcard $(BUILDDIR)/*)
install: all
$(MKDIR) $(DESTDIR)$(PREFIX)/bin
$(CP) $(BUILDDIR)/$(NAME) $(DESTDIR)$(PREFIX)/bin
$(CHMOD) 755 $(DESTDIR)$(PREFIX)/bin/$(NAME)
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/$(NAME)
re: fclean all