Skip to content

Commit

Permalink
hello demo: use elf instead of exe
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Oct 28, 2024
1 parent 8cf5c64 commit 8cb3e88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demos/hello/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hello World demo

This demo shows the basic usage of dj64 tool-chain.
Just build an app from a single C source file.
Just build an app from a single C source file into an ELF file.

## building

Expand Down
13 changes: 4 additions & 9 deletions demos/hello/makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
LINK = djlink
STRIP = @true
# or use `STRIP = djstrip` for non-debug build

SOURCES = hello.c
TGT = hello.exe
TGT = hello

# the below 4 vars must be named exactly like here
CFLAGS = -Wall -ggdb3
Expand All @@ -22,7 +18,7 @@ info: $(TGT)
djstubify -i $<

run: $(TGT)
dosemu -dumb $<
dosemu -dumb -K . -E "elfexec $<"

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
Expand All @@ -37,7 +33,6 @@ endif

# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
ifeq ($(filter info run,$(MAKECMDGOALS)),)
$(TGT): $(DJ64_XOBJS)
$(LINK) -d dosemu_$@.dbg $(DJ64_XLIB) -n $@ -o $@ $(DJ64_XLDFLAGS)
$(STRIP) $@
$(TGT): $(DJ64_XLIB)
cp $< $@
endif

0 comments on commit 8cb3e88

Please sign in to comment.