mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
src/Makefile: use an explicit .depend file.
This commit is contained in:
parent
7bbbfce482
commit
117f9eddcd
|
@ -8,6 +8,7 @@ syntax: regexp
|
||||||
|
|
||||||
syntax: glob
|
syntax: glob
|
||||||
|
|
||||||
|
.depend
|
||||||
Makevars.local
|
Makevars.local
|
||||||
|
|
||||||
*.a
|
*.a
|
||||||
|
|
19
src/Makefile
19
src/Makefile
|
@ -27,7 +27,6 @@ ifneq ($(findstring $(firstword $(CXX)),g++),)
|
||||||
USE_GNUC ?= 1
|
USE_GNUC ?= 1
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_GNUC),1)
|
ifeq ($(USE_GNUC),1)
|
||||||
CXXFLAGS += -MMD
|
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CXXFLAGS += -O0 -g
|
CXXFLAGS += -O0 -g
|
||||||
else
|
else
|
||||||
|
@ -59,17 +58,25 @@ INCLUDES += -I$(UPX_LZMADIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: upx$(exeext)
|
all: .depend upx$(exeext)
|
||||||
.DELETE_ON_ERROR: upx$(exeext) $(upx_OBJECTS)
|
.DELETE_ON_ERROR: .depend upx$(exeext) $(upx_OBJECTS)
|
||||||
|
|
||||||
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
|
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
|
||||||
$($(notdir $@).PRE_LINK_STEP)
|
$($(notdir $@).PRE_LINK_STEP)
|
||||||
$(strip $(CXXLD) $(call e,CPPFLAGS) $(call e,CXXFLAGS) $(call e,LDFLAGS) -o $@ $(upx_OBJECTS) $(call e,LDADD) $(call e,LIBS))
|
$(strip $(CXXLD) $(call e,CPPFLAGS) $(call e,CXXFLAGS) $(call e,LDFLAGS) -o $@ $(upx_OBJECTS) $(call e,LDADD) $(call e,LIBS))
|
||||||
$($(notdir $@).POST_LINK_STEP)
|
$($(notdir $@).POST_LINK_STEP)
|
||||||
|
|
||||||
%.o : %.cpp
|
%.o : %.cpp .depend
|
||||||
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
|
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
|
||||||
|
|
||||||
|
.depend: $(wildcard $(srcdir)/*.cpp) $(wildcard $(srcdir)/*.h) $(MAKEFILE_LIST)
|
||||||
|
@rm -f $@
|
||||||
|
ifeq ($(USE_GNUC),1)
|
||||||
|
$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
|
||||||
|
else
|
||||||
|
touch $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(USE_GNUC),1)
|
ifeq ($(USE_GNUC),1)
|
||||||
##compress_lzma$(objext) : CXXFLAGS += -O3 -fomit-frame-pointer
|
##compress_lzma$(objext) : CXXFLAGS += -O3 -fomit-frame-pointer
|
||||||
|
@ -82,7 +89,7 @@ endif
|
||||||
|
|
||||||
|
|
||||||
mostlyclean clean distclean maintainer-clean:
|
mostlyclean clean distclean maintainer-clean:
|
||||||
rm -f *.d *.map *.o *.obj *.res upx.exe upx.out upx.ttp upx$(exeext)
|
rm -f *.d *.map *.o *.obj *.res .depend upx.exe upx.out upx.ttp upx$(exeext)
|
||||||
|
|
||||||
-include *.d
|
include $(wildcard .depend)
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
.PHONY: all mostlyclean clean distclean maintainer-clean
|
||||||
|
|
Loading…
Reference in New Issue
Block a user