new makefile
This commit is contained in:
parent
d6283d31cd
commit
11abe9c6c7
19
Makefile
19
Makefile
@ -1,2 +1,17 @@
|
|||||||
all:
|
CC = gcc
|
||||||
gcc -Wall -Wextra -pedantic -Werror -o executable c-basic/*.c
|
CFLAGS = -Wall -Wextra -std=c11
|
||||||
|
SRCDIR = .
|
||||||
|
SRC = $(wildcard $(SRCDIR)/*.c)
|
||||||
|
OBJ = $(SRC:.c=.o)
|
||||||
|
TARGET = main
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
$(TARGET): $(OBJ)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $^
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJ) $(TARGET)
|
Loading…
x
Reference in New Issue
Block a user