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