From ab841a6188346f4ca621e28f8b6e4b6a12d322ac Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sun, 21 Jun 2026 09:48:14 +0300 Subject: [PATCH] demos: fix dj32 arm build Needs to export cross-tools for djlink. --- demos/asmsimp/32/makefile | 13 ++++++++++--- demos/asmsimp/makefile | 6 +++--- demos/file/32/makefile | 13 ++++++++++--- demos/file/makefile | 6 +++--- demos/helloasm/32/makefile | 13 ++++++++++--- demos/helloasm/makefile | 6 +++--- demos/int86/32/makefile | 13 ++++++++++--- demos/int86/makefile | 6 +++--- demos/rmcb/32/makefile | 13 ++++++++++--- demos/rmcb/makefile | 6 +++--- 10 files changed, 65 insertions(+), 30 deletions(-) diff --git a/demos/asmsimp/32/makefile b/demos/asmsimp/32/makefile index 8da0d974..cff37154 100644 --- a/demos/asmsimp/32/makefile +++ b/demos/asmsimp/32/makefile @@ -2,8 +2,8 @@ srcdir = .. vpath %.c $(srcdir) vpath %.S $(srcdir) -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES := hello.c thunks_p.c SOURCES := $(addprefix $(srcdir)/,$(SOURCES)) @@ -42,7 +42,14 @@ else include $(DJMK) endif +ifneq ($(CROSS_PREFIX),) +# for djlink on arm +export READELF = $(CROSS_PREFIX)readelf +export OBJCOPY = $(CROSS_PREFIX)objcopy +export STRIP = $(CROSS_PREFIX)strip +endif + # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ diff --git a/demos/asmsimp/makefile b/demos/asmsimp/makefile index 808143bd..c36f282c 100644 --- a/demos/asmsimp/makefile +++ b/demos/asmsimp/makefile @@ -1,5 +1,5 @@ -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES = hello.c thunks_p.c AS_SOURCES = h.S @@ -40,7 +40,7 @@ endif # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ djgpp/%: $(MAKE) -C djgpp $* diff --git a/demos/file/32/makefile b/demos/file/32/makefile index 039bb294..2727bbff 100644 --- a/demos/file/32/makefile +++ b/demos/file/32/makefile @@ -2,8 +2,8 @@ srcdir = .. vpath %.c $(srcdir) vpath %.S $(srcdir) -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES := file.c SOURCES := $(addprefix $(srcdir)/,$(SOURCES)) @@ -37,7 +37,14 @@ else include $(DJMK) endif +ifneq ($(CROSS_PREFIX),) +# for djlink on arm +export READELF = $(CROSS_PREFIX)readelf +export OBJCOPY = $(CROSS_PREFIX)objcopy +export STRIP = $(CROSS_PREFIX)strip +endif + # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ diff --git a/demos/file/makefile b/demos/file/makefile index d5ddd3a3..872bb637 100644 --- a/demos/file/makefile +++ b/demos/file/makefile @@ -1,5 +1,5 @@ -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES = file.c TGT = file.exe @@ -37,7 +37,7 @@ endif # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ djgpp/%: $(MAKE) -C djgpp $* diff --git a/demos/helloasm/32/makefile b/demos/helloasm/32/makefile index b1f87e37..7e7de247 100644 --- a/demos/helloasm/32/makefile +++ b/demos/helloasm/32/makefile @@ -2,8 +2,8 @@ srcdir = .. vpath %.c $(srcdir) vpath %.S $(srcdir) -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES := hello.c thunks_a.c thunks_c.c thunks_p.c SOURCES := $(addprefix $(srcdir)/,$(SOURCES)) @@ -44,7 +44,14 @@ else include $(DJMK) endif +ifneq ($(CROSS_PREFIX),) +# for djlink on arm +export READELF = $(CROSS_PREFIX)readelf +export OBJCOPY = $(CROSS_PREFIX)objcopy +export STRIP = $(CROSS_PREFIX)strip +endif + # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ diff --git a/demos/helloasm/makefile b/demos/helloasm/makefile index fd4ee10f..f7687d41 100644 --- a/demos/helloasm/makefile +++ b/demos/helloasm/makefile @@ -1,5 +1,5 @@ -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES = hello.c thunks_a.c thunks_c.c thunks_p.c AS_SOURCES = h.S @@ -41,7 +41,7 @@ endif # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ djgpp/%: $(MAKE) -C djgpp $* diff --git a/demos/int86/32/makefile b/demos/int86/32/makefile index 039bb294..2727bbff 100644 --- a/demos/int86/32/makefile +++ b/demos/int86/32/makefile @@ -2,8 +2,8 @@ srcdir = .. vpath %.c $(srcdir) vpath %.S $(srcdir) -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES := file.c SOURCES := $(addprefix $(srcdir)/,$(SOURCES)) @@ -37,7 +37,14 @@ else include $(DJMK) endif +ifneq ($(CROSS_PREFIX),) +# for djlink on arm +export READELF = $(CROSS_PREFIX)readelf +export OBJCOPY = $(CROSS_PREFIX)objcopy +export STRIP = $(CROSS_PREFIX)strip +endif + # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ diff --git a/demos/int86/makefile b/demos/int86/makefile index d5ddd3a3..872bb637 100644 --- a/demos/int86/makefile +++ b/demos/int86/makefile @@ -1,5 +1,5 @@ -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES = file.c TGT = file.exe @@ -37,7 +37,7 @@ endif # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ djgpp/%: $(MAKE) -C djgpp $* diff --git a/demos/rmcb/32/makefile b/demos/rmcb/32/makefile index 2b93dbd5..61f533ef 100644 --- a/demos/rmcb/32/makefile +++ b/demos/rmcb/32/makefile @@ -2,8 +2,8 @@ srcdir = .. vpath %.c $(srcdir) vpath %.S $(srcdir) -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES := main.c mouse.c thunks_a.c thunks_c.c SOURCES := $(addprefix $(srcdir)/,$(SOURCES)) @@ -44,7 +44,14 @@ else include $(DJMK) endif +ifneq ($(CROSS_PREFIX),) +# for djlink on arm +export READELF = $(CROSS_PREFIX)readelf +export OBJCOPY = $(CROSS_PREFIX)objcopy +export STRIP = $(CROSS_PREFIX)strip +endif + # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ diff --git a/demos/rmcb/makefile b/demos/rmcb/makefile index 9408db86..0132faaa 100644 --- a/demos/rmcb/makefile +++ b/demos/rmcb/makefile @@ -1,5 +1,5 @@ -STRIP = @true -# or use `STRIP = djstrip` for non-debug build +DJSTRIP = @true +# or use `DJSTRIP = djstrip` for non-debug build SOURCES = main.c mouse.c thunks_a.c thunks_c.c AS_SOURCES = ms.S asm.S @@ -41,7 +41,7 @@ endif # dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS` $(TGT): $(DJ64_XLIB) $(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS) - $(STRIP) $@ + $(DJSTRIP) $@ djgpp/%: $(MAKE) -C djgpp $*