1 CC := gcc 2 CLIBS := 3 CFLAGS := -Wall -Wshadow -pedantic -ansi -std=c99 -O3 4 SRCS := $(wildcard *.c) 5 OBJS := $(SRCS:.c=.o) 6 7 TARGET := main 8 9 .PHONY: all clean viz 10 11 all: $(TARGET) 12 13 $(TARGET): $(OBJS) 14 $(CC) $(CLIBS) $(CFLAGS) -o $@ $^ 15 rm -f $(OBJS) 16 17 %.o: %.c 18 $(CC) $(CLIBS) $(CFLAGS) -c $< -o $@ 19 20 clean: 21 rm -f $(OBJS)