简单的单一目录:
PROGRAM = test
CC = g++
CPP = cpp
RM = rm -f
CFLLAGS = -g
CPPFLAGS = -g
LDFLAGS =
%.o : %.cpp
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) \
$(patsubst %.c,%.o,$(wildcard *.c))
$(PROGRAM) : $(OBJS)
$(RM) $@
$(CC) -o $@ $(OBJS)
clean:
rm -f $(PROGRAM)
rm -f *.o