1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
SRCS = $(wildcard *.cc)
OBJS = $(SRCS:.cc=.o)
BIN = test
WARNINGS = -W -Wall -pedantic -Werror -O2 -Wchar-subscripts -Wcomment -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-noreturn -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wno-long-long
CFLAGS = $(WARNINGS)
LDFLAGS =
all: $(BIN)
$(BIN) : $(OBJS)
$(CC) -o $@ $(LDFLAGS) $<
%.o : %.cc
$(CC) -o $@ $(CFLAGS) -c $^
clean:
rm -rf $(OBJS)
rm -rf *~
clean_all: clean
rm -rf $(BIN) |