Running commands before and after deployment, Build output with pre-build and post-build steps, Adding custom pre-deploy and post-deploy targets – HP Integrity NonStop J-Series User Manual

Page 64

Advertising
background image

Example 7 Build Output with pre-build and post-build steps

# All Target
all: pre-build main-build

# Main-build Target
main-build: Car.txe

# Tool invocations
Car.txe: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: C++ Linker (TNS/E)'
c89 -Wcplusplus -Wsystype=guardian -Wcall_shared -o "Car.txe" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(MAKE) --no-print-directory post-build
.
.
.
pre-build:
-@echo 'Pre-build action'
-echo "Build is starting..."
-@echo ' '

post-build:
-@echo 'Post-build action'
-echo "Build has completed"
-@echo ' '

Running commands before and after deployment

Commands can be set to run before and after deploying the final build object. Unlike pre-build
and post-build steps, you must define your own pre-deploy and post-deploy targets, and can use
names other than "pre-deploy" and "post-deploy" as target names.

Example 8 “Adding custom pre-deploy and post-deploy targets”

shows adding targets using the

Settings (Remote) project property page.

Example 8 Adding custom pre-deploy and post-deploy targets

Adding my-pre-deploy and my-post-deploy targets writes a deploy target similar to the
following to the main makefile on your next build:

deploy: Car.txe my-pre-deploy
@echo 'Invoking: Deploy Tool'
java -jar "C:/e3.7/eclipse/plugins/com.hp.nsdee_1.0.0/Tools/Deploy.jar"...

64

Concepts

Advertising
This manual is related to the following products: