update Makefile from master

cpp
Avril 4 years ago
parent dba703e503
commit 260a04f614
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -41,16 +41,16 @@ OBJ = $(OBJ_C) $(OBJ_CXX)
# Phonies # Phonies
.PHONY: release .PHONY: release
release: | dirs $(PROJECT)-release.a release: | dirs lib$(PROJECT)-release.a
-$(MAKE) clean-rebuild -$(MAKE) clean-rebuild
-$(MAKE) dirs -$(MAKE) dirs
$(MAKE) $(PROJECT)-release.so $(MAKE) lib$(PROJECT)-release.so
.PHONY: debug .PHONY: debug
debug: | dirs $(PROJECT)-debug.a debug: | dirs lib$(PROJECT)-debug.a
-$(MAKE) clean-rebuild -$(MAKE) clean-rebuild
-$(MAKE) dirs -$(MAKE) dirs
$(MAKE) $(PROJECT)-debug.so $(MAKE) lib$(PROJECT)-debug.so
# Rebuild both release and debug targets from scratch # Rebuild both release and debug targets from scratch
.PHONY: all .PHONY: all
@ -70,36 +70,36 @@ obj/c/%.o: %.c
obj/cxx/%.o: %.cpp obj/cxx/%.o: %.cpp
$(CXX) -c $< $(CXXFLAGS) -o $@ $(LDFLAGS) $(CXX) -c $< $(CXXFLAGS) -o $@ $(LDFLAGS)
$(PROJECT)-release.a: CFLAGS+= $(RELEASE_CFLAGS) lib$(PROJECT)-release.a: CFLAGS+= $(RELEASE_CFLAGS)
$(PROJECT)-release.a: CXXFLAGS += $(RELEASE_CXXFLAGS) lib$(PROJECT)-release.a: CXXFLAGS += $(RELEASE_CXXFLAGS)
$(PROJECT)-release.a: LDFLAGS += $(RELEASE_LDFLAGS) lib$(PROJECT)-release.a: LDFLAGS += $(RELEASE_LDFLAGS)
$(PROJECT)-release.a: $(OBJ) lib$(PROJECT)-release.a: $(OBJ)
ar rcs $@ $^ ar rcs $@ $^
ln -sf $@ $(PROJECT).a ln -sf $@ lib$(PROJECT).a
$(PROJECT)-debug.a: CFLAGS+= $(DEBUG_CFLAGS) lib$(PROJECT)-debug.a: CFLAGS+= $(DEBUG_CFLAGS)
$(PROJECT)-debug.a: CXXFLAGS += $(DEBUG_CXXFLAGS) lib$(PROJECT)-debug.a: CXXFLAGS += $(DEBUG_CXXFLAGS)
$(PROJECT)-debug.a: LDFLAGS += $(DEBUG_LDFLAGS) lib$(PROJECT)-debug.a: LDFLAGS += $(DEBUG_LDFLAGS)
$(PROJECT)-debug.a: $(OBJ) lib$(PROJECT)-debug.a: $(OBJ)
ar rcs $@ $^ ar rcs $@ $^
$(PROJECT)-release.so: CFLAGS+= $(RELEASE_CFLAGS) -fPIC lib$(PROJECT)-release.so: CFLAGS+= $(RELEASE_CFLAGS) -fPIC
$(PROJECT)-release.so: CXXFLAGS += $(RELEASE_CXXFLAGS) -fPIC lib$(PROJECT)-release.so: CXXFLAGS += $(RELEASE_CXXFLAGS) -fPIC
$(PROJECT)-release.so: LDFLAGS += $(RELEASE_LDFLAGS) lib$(PROJECT)-release.so: LDFLAGS += $(RELEASE_LDFLAGS)
$(PROJECT)-release.so: $(OBJ) lib$(PROJECT)-release.so: $(OBJ)
$(CXX) -shared $^ -o $@ $(CXX) -shared $^ -o $@
$(STRIP) $@ $(STRIP) $@
ln -sf $@ $(PROJECT).so ln -sf $@ lib$(PROJECT).so
$(PROJECT)-debug.so: CFLAGS+= $(DEBUG_CFLAGS) -fPIC lib$(PROJECT)-debug.so: CFLAGS+= $(DEBUG_CFLAGS) -fPIC
$(PROJECT)-debug.so: CXXFLAGS += $(DEBUG_CXXFLAGS) -fPIC lib$(PROJECT)-debug.so: CXXFLAGS += $(DEBUG_CXXFLAGS) -fPIC
$(PROJECT)-debug.so: LDFLAGS += $(DEBUG_LDFLAGS) lib$(PROJECT)-debug.so: LDFLAGS += $(DEBUG_LDFLAGS)
$(PROJECT)-debug.so: $(OBJ) lib$(PROJECT)-debug.so: $(OBJ)
$(CXX) -shared $^ -o $@ $(CXX) -shared $^ -o $@
clean-rebuild: clean-rebuild:
rm -rf obj rm -rf obj
clean: clean-rebuild clean: clean-rebuild
rm -f $(PROJECT){,-{release,debug,pgo}}.{a,so} rm -f lib$(PROJECT){,-{release,debug,pgo}}.{a,so}

Loading…
Cancel
Save