new makefile
This commit is contained in:
parent
d6283d31cd
commit
11abe9c6c7
1 changed files with 17 additions and 2 deletions
19
Makefile
19
Makefile
|
@ -1,2 +1,17 @@
|
|||
all:
|
||||
gcc -Wall -Wextra -pedantic -Werror -o executable c-basic/*.c
|
||||
CC = gcc
|
||||
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…
Add table
Reference in a new issue