Makefile (394B)
1 2 NAME=$(shell basename ${PWD}) 3 SRC=$(wildcard *.c) 4 DEPS:=$(wildcard *.h) 5 OBJ:=$(SRC:.c=.o) 6 CFLAGS=-O2 -std=c11 -Werror -Wall -Wextra -I. -I../common 7 LDFLAGS=-lc 8 9 all: $(NAME) 10 11 .PHONY: clean run 12 13 clean: 14 rm -f $(OBJ) $(NAME) 15 16 %.o : %.c $(DEPS) 17 @$(CC) $(CFLAGS) -c $< -o $@ 18 19 $(NAME): $(OBJ) 20 @$(CC) $(OBJ) -o $@ $(LDFLAGS) 21 22 run: $(NAME) 23 @./$(NAME) input.txt 24 25 test: $(NAME) 26 @./$(NAME) test.txt