Either PRE_TARGETDEPS or POST_TARGETDEPS:
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
PRE_TARGETDEPS += doit_before
POST_TARGETDEPS += doit_after
# Input
SOURCES += main.cpp
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
PRE_TARGETDEPS += doit_before
POST_TARGETDEPS += doit_after
# Input
SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode
generates:
...
all: Makefile $(TARGET)
$(TARGET): doit_before $(OBJECTS) doit_after
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
...
...
all: Makefile $(TARGET)
$(TARGET): doit_before $(OBJECTS) doit_after
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
...
To copy to clipboard, switch view to plain text mode
and if doit_before or doit_after are files changing them has the desired effect of rebuilding the target.
Bookmarks