|
Target := testit
MainSources := testit.cpp SharedSrc := foo_hallo.cpp foo_welt.cpp Sources := $(wildcard *.[ch]pp) CPPFiles := $(wildcard *.cpp) Objects := $(patsubst %.cpp,%.o,$(CPPFiles)) SharedObjs := $(patsubst %.cpp,%.so,$(SharedSrc)) MainObjs := $(patsubst %.cpp,%.o,$(MainSources)) CC := g++ CXX := g++ CXXFLAGS := -Wall -g CPPFLAGS := -std=gnu++11 SHARED := -fPIC -shared LDFLAGS := -rdynamic .PHONY: all depend clean realclean all: makefile $(Target) $(SharedObjs) depend: ; gcc-makedepend $(CPPFLAGS) $(CPPFiles) makefile: $(Sources) gcc-makedepend $(CPPFLAGS) $(CPPFiles) clean: ; rm -f $(Objects) realclean: clean rm -f $(Target) $(SharedObjs) $(Target): $(MainObjs) $(CXX) -o $@ $(LDFLAGS) $(MainObjs) $(LDLIBS) $(SharedObjs): %.so: %.cpp $(CXX) -o $@ $(SHARED) $(CPPFLAGS) $(CXXFLAGS) \ $(LDFLAGS) $< $(LDLIBS) # DO NOT DELETE foo_hallo.o: foo_hallo.cpp foo.hpp testit.o: testit.cpp foo.hpp foo_welt.o: foo_welt.cpp foo.hpp |