24 lines
424 B
Makefile
24 lines
424 B
Makefile
|
SRC = src/main.c
|
||
|
OJB = $(SRC:.c=.o)
|
||
|
OUT = build
|
||
|
|
||
|
CC = /usr/bin/gcc
|
||
|
CFLAGS = -ansi -Wall -std=c99
|
||
|
CFDEBUG = -ansi -Wall -fsanitize=address -g -std=c99
|
||
|
RM = /bin/rm -f $(OUT)
|
||
|
|
||
|
%.o: %.c
|
||
|
$(CC) -c $(CFLAGS)
|
||
|
|
||
|
build:
|
||
|
$(CC) $(SRC) $(CFLAGS) -o $(OUT)/main.o
|
||
|
|
||
|
debug:
|
||
|
$(CC) $(SRC) $(CFDEBUG) -o $(OUT)/main.o
|
||
|
|
||
|
clean:
|
||
|
$(RM) $(OBJ) $(OUT)/main.o
|
||
|
|
||
|
run: $(SRC)
|
||
|
$(CC) $(SRC) $(CFLAGS) -o $(OUT)/main.o && ./build/main.o
|