Files
Anthony PERARD 3a206abcd7 tools/debugger/gdbsx: Fix and cleanup makefiles
gdbsx/:
  - Make use of subdir facility for the "clean" target.
  - No need to remove the *.a, they aren't in this dir.
  - Avoid calling "distclean" in subdirs as "distclean" targets do only
    call "clean", and the "clean" also runs "clean" in subdirs.
  - Avoid the need to make "gx_all.a" and "xg_all.a" in the "all"
    recipe by forcing make to check for update of "xg/xg_all.a" and
    "gx/gx_all.a" by having "FORCE" as prerequisite. Now, when making
    "gdbsx", make will recurse even when both *.a already exist.
  - List target in $(TARGETS).

gdbsx/*/:
  - Fix dependency on *.h.
  - Remove some dead code.
  - List targets in $(TARGETS).
  - Remove "build" target.
  - Cleanup "clean" targets.
  - remove comments about the choice of "ar" instead of "ld"
  - Use "$(AR)" instead of plain "ar".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
2022-10-14 16:16:54 +01:00

35 lines
560 B
Makefile

XEN_ROOT = $(CURDIR)/../../..
include ./Rules.mk
SUBDIRS-y += gx
SUBDIRS-y += xg
TARGETS := gdbsx
.PHONY: all
all: $(TARGETS)
.PHONY: clean
clean: subdirs-clean
rm -f $(TARGETS)
.PHONY: distclean
distclean: clean
.PHONY: install
install: all
[ -d $(DESTDIR)$(sbindir) ] || $(INSTALL_DIR) $(DESTDIR)$(sbindir)
$(INSTALL_PROG) gdbsx $(DESTDIR)$(sbindir)/gdbsx
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(sbindir)/gdbsx
gdbsx: gx/gx_all.a xg/xg_all.a
$(CC) $(LDFLAGS) -o $@ $^
xg/xg_all.a: FORCE
$(MAKE) -C xg
gx/gx_all.a: FORCE
$(MAKE) -C gx