commit e494e02c837088e25f84506a0d27898a7e0bb9bd from: Aleksey Ryndin date: Fri Aug 18 13:00:45 2023 UTC Patch from la-ninpre > Separate compilation enables incremental recompilation > instead of redoing the whole work from scratch each time. > Separating compilation also enables developer to use `-j` > option of make to speed up the compilation. > I also made Makefile respect CXXFLAGS provided in the > environment, so that one can set certain optimization > flags, for example. commit - 66b4d5213bcab3f70a42354d0833741a8cf7eeb8 commit + e494e02c837088e25f84506a0d27898a7e0bb9bd blob - ae7abe5252f36df871ce94207abed46800156dd8 blob + 3419f6a439dcda6470e1535d68ec645f0d352f8a --- Makefile +++ Makefile @@ -3,7 +3,7 @@ all: server clean: - rm -rf vostok/vostok + ${MAKE} -C vostok clean server: ${MAKE} -C vostok blob - 9ac28c40d073d08304d261ac84db6659466f4c1f blob + 0e2a0e4da8de989adf1eaa3f43065014ec8d7577 --- vostok/Makefile +++ vostok/Makefile @@ -1,4 +1,4 @@ -CXXFLAGS = -Wall -Wextra -std=c++11 -I../shared +CXXFLAGS += -Wall -Wextra -std=c++11 -I../shared LIBS = -ltls CXXFILES = transport.cc @@ -14,5 +14,15 @@ HXXFILES += parse_url.h CXXFILES += vostok.cc HXXFILES += utils.h -vostok: ${CXXFILES} ${HXXFILES} - ${CXX} ${CXXFLAGS} ${CXXFILES} ${LIBS} -o vostok +OFILES = ${CXXFILES:.cc=.o} + +.cc.o: + ${CXX} ${CXXFLAGS} -c -o $@ $< + +vostok: ${OFILES} + ${CXX} ${LDFLAGS} -o $@ ${OFILES} ${LIBS} + +clean: + rm -f ${OFILES} vostok + +.PHONY: cleaN