自动生成对应c或cpp文件的可执行文件,方便写些小的测试程序
LIBS = gstreamer-1.0
CFLAGS := -Wall -g -I.
CFLAGS += $(shell pkg-config --cflags $(LIBS))
CXXFLAGS := -Wall -g -I.
CXXFLAGS += $(shell pkg-config --cflags $(LIBS))
LDFLAGS := $(shell pkg-config --libs-only-L $(LIBS))
LDLIBS := -lm
LDLIBS += $(shell pkg-config --libs-only-l $(LIBS))
CSRCS := $(wildcard *.c)
OBJS := $(patsubst %.c, %, $(CSRCS))
CXXSRCS += $(wildcard *.cpp)
OBJS += $(patsubst %.cpp, %, $(CXXSRCS))
all: $(OBJS)
print-%: ; @echo $* = $($*)