diff options
author | Jim Blandy <jimb@red-bean.com> | 2020-07-31 19:53:50 +0300 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 2020-07-31 21:08:36 +0300 |
commit | 7bc8c6283acf2866eaea7e95d362c962e61cc401 (patch) | |
tree | 98f4e4868c2b4d1a16f4ad83b4ef83ba3639eec0 /library | |
parent | 9d25f7fb713138feb1139776d7b786a02b5d2a12 (diff) |
Factor out Unix build logic into shared files.
Diffstat (limited to 'library')
-rw-r--r-- | library/unix/build.mk | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/library/unix/build.mk b/library/unix/build.mk index 42bd6866..b26786a2 100644 --- a/library/unix/build.mk +++ b/library/unix/build.mk @@ -5,44 +5,8 @@ INCLUDES := LIBS := -lpthread -ldl PROJECT := libtracy IMAGE := $(PROJECT)-$(BUILD).so +SHARED_LIBRARY := yes SRC := ../../TracyClient.cpp -OBJDIRBASE := obj/$(BUILD) -OBJDIR := $(OBJDIRBASE)/o/o/o - -OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o)) - -all: $(IMAGE) - -$(OBJDIR)/%.o: %.cpp - $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@ - -$(OBJDIR)/%.d : %.cpp - @echo Resolving dependencies of $< - @mkdir -p $(@D) - @$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \ - sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -$(OBJDIR)/%.o: %.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -$(OBJDIR)/%.d : %.c - @echo Resolving dependencies of $< - @mkdir -p $(@D) - @$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \ - sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -$(IMAGE): $(OBJ) - $(CXX) $(CXXFLAGS) $(DEFINES) $(OBJ) $(LIBS) -shared -o $@ - -ifneq "$(MAKECMDGOALS)" "clean" --include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) -endif - -clean: - rm -rf $(OBJDIRBASE) $(PROJECT)*.so - -.PHONY: clean all +include ../../common/unix.mk |