mirror of
https://github.com/guezoloic/libft.git
synced 2026-01-25 01:34:15 +00:00
feat: init makefile and ignore all .pdf files
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -53,3 +53,5 @@ dkms.conf
|
|||||||
|
|
||||||
# debug information files
|
# debug information files
|
||||||
*.dwo
|
*.dwo
|
||||||
|
|
||||||
|
*.pdf
|
||||||
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# .SILENT:
|
||||||
|
.PHONY: all clean
|
||||||
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
|
SRC = $(wildcard *.c)
|
||||||
|
LIB = libft.a
|
||||||
|
STATIC = ar -rcs
|
||||||
|
CC = clang
|
||||||
|
OBJ = $(SRC:.c=.o)
|
||||||
|
CFLAGS = -Wall -Wextra -Werror -pedantic
|
||||||
|
|
||||||
|
$(LIB): $(OBJ) # <--- OBJ will run $.o: %.c pattern
|
||||||
|
$(STATIC) $(LIB) $(OBJ)
|
||||||
|
|
||||||
|
%.o: %.c # <--- compile any .c file into its corresponding .o automatically
|
||||||
|
${CC} ${CFLAGS} -c $< -o $@
|
||||||
|
|
||||||
|
all: $(LIB)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJ) $(LIB)
|
||||||
Reference in New Issue
Block a user