Skip to content

Commit f3b341f

Browse files
Virat Agarwalheeran-xilinx
authored andcommitted
Adding post_launch (#427)
1 parent 045d2f0 commit f3b341f

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

common/utility/makefile_gen/makegen.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,15 @@ def mk_check(target, data):
434434
arg = arg.replace('BUILD', '$(BUILD_DIR)')
435435
arg = arg.replace('PROJECT', '.')
436436
target.write(arg)
437+
if "post_launch" in data:
438+
for post_launch in data["post_launch"]:
439+
if "launch_cmd" in post_launch:
440+
target.write("\n")
441+
args = post_launch["launch_cmd"]
442+
args = args.replace('BUILD', '$(BUILD_DIR)')
443+
args = args.replace("REPO_DIR","$(ABS_COMMON_REPO)")
444+
args = args.replace('HOST_EXE', '$(EXE_FILE)')
445+
target.write("\t" + args)
437446
target.write("\nendif\n")
438447
target.write("endif\n")
439448
if "targets" in data:
@@ -449,7 +458,7 @@ def mk_check(target, data):
449458
target.write(arg)
450459
target.write(" TARGET. Please use the target for running the application)\n")
451460
target.write("endif\n")
452-
target.write("\n\n")
461+
target.write("\n")
453462

454463
def mk_run(target, data):
455464
target.write("############################## Setting Essential Checks and Running Rules ##############################\n")
@@ -497,8 +506,17 @@ def mk_run(target, data):
497506
arg = arg.replace('BUILD', '$(BUILD_DIR)')
498507
arg = arg.replace('PROJECT', '.')
499508
target.write(arg)
509+
if "post_launch" in data:
510+
for post_launch in data["post_launch"]:
511+
if "launch_cmd" in post_launch:
512+
target.write("\n")
513+
args = post_launch["launch_cmd"]
514+
args = args.replace('BUILD', '$(BUILD_DIR)')
515+
args = args.replace("REPO_DIR","$(ABS_COMMON_REPO)")
516+
args = args.replace('HOST_EXE', '$(EXE_FILE)')
517+
target.write("\t" + args)
500518
target.write("\nendif\n")
501-
target.write("endif\n")
519+
target.write("endif")
502520
if "targets" in data:
503521
target.write("ifneq ($(TARGET),$(findstring $(TARGET),")
504522
args = data["targets"]
@@ -515,7 +533,7 @@ def mk_run(target, data):
515533
target.write("\n")
516534

517535

518-
target.write("\n")
536+
target.write("\n\n")
519537

520538
target.write(".PHONY: test\n")
521539
target.write("test: $(EXECUTABLE)\n")
@@ -550,6 +568,15 @@ def mk_run(target, data):
550568
arg = arg.replace('BUILD', '$(BUILD_DIR)')
551569
arg = arg.replace('PROJECT', '.')
552570
target.write(arg)
571+
if "post_launch" in data:
572+
for post_launch in data["post_launch"]:
573+
if "launch_cmd" in post_launch:
574+
target.write("\n")
575+
args = post_launch["launch_cmd"]
576+
args = args.replace('BUILD', '$(BUILD_DIR)')
577+
args = args.replace("REPO_DIR","$(ABS_COMMON_REPO)")
578+
args = args.replace('HOST_EXE', '$(EXE_FILE)')
579+
target.write("\t" + args)
553580
target.write("\nelse\n")
554581
target.write("\t$(ECHO) \"Please copy the content of sd_card folder and data to an SD Card and run on the board\"")
555582
target.write("\nendif\n")

0 commit comments

Comments
 (0)