Skip to content

Commit 85b1fd6

Browse files
authored
Merge pull request #61 from stsp/32
32
2 parents c1c6309 + d6d9682 commit 85b1fd6

14 files changed

Lines changed: 295 additions & 8 deletions

File tree

‎.github/workflows/ci-build.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
run: |
2828
make deb
2929
sudo dpkg -i ../dj64*.deb
30+
sudo dpkg -i ../dj32*.deb
3031
3132
- name: Set up test environment
3233
run: |

‎demos/asmsimp/32/makefile‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
STRIP = @true
6+
# or use `STRIP = djstrip` for non-debug build
7+
8+
SOURCES := hello.c thunks_p.c
9+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
10+
AS_SOURCES := h.S
11+
AS_SOURCES := $(addprefix $(srcdir)/,$(AS_SOURCES))
12+
TGT = asmsimp.exe
13+
14+
# the below 4 vars must be named exactly like here
15+
DJCFLAGS = -Wall -ggdb3
16+
DJCPPFLAGS = -I. -I$(srcdir)
17+
DJASFLAGS = -I. -I$(srcdir)
18+
OBJECTS = $(notdir $(SOURCES:.c=.o))
19+
AS_OBJECTS = $(notdir $(AS_SOURCES:.S=.o))
20+
PDHDR = $(srcdir)/asm.h
21+
22+
all: $(TGT)
23+
24+
clean: clean_dj32
25+
$(RM) $(TGT)
26+
27+
# display info about the built executable
28+
info: $(TGT)
29+
djstubify -i $<
30+
31+
run: $(TGT)
32+
dosemu -dumb $<
33+
34+
# hook in dj64 - make sure to not do that before defining `all:` target
35+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
36+
ifeq ($(wildcard $(DJMK)),)
37+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
38+
$(error dj32 not installed)
39+
endif
40+
clean_dj32:
41+
else
42+
include $(DJMK)
43+
endif
44+
45+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
46+
$(TGT): $(DJ64_XLIB)
47+
$(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS)
48+
$(STRIP) $@

‎demos/file/32/makefile‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
STRIP = @true
6+
# or use `STRIP = djstrip` for non-debug build
7+
8+
SOURCES := file.c
9+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
10+
TGT = file.exe
11+
12+
# the below 4 vars must be named exactly like here
13+
DJCFLAGS = -Wall -ggdb3
14+
DJCPPFLAGS = -I. -I$(srcdir)
15+
OBJECTS = $(notdir $(SOURCES:.c=.o))
16+
17+
all: $(TGT)
18+
19+
clean: clean_dj32
20+
$(RM) $(TGT)
21+
22+
# display info about the built executable
23+
info: $(TGT)
24+
djstubify -i $<
25+
26+
run: $(TGT)
27+
dosemu -t $<
28+
29+
# hook in dj64 - make sure to not do that before defining `all:` target
30+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
31+
ifeq ($(wildcard $(DJMK)),)
32+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
33+
$(error dj32 not installed)
34+
endif
35+
clean_dj32:
36+
else
37+
include $(DJMK)
38+
endif
39+
40+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
41+
$(TGT): $(DJ64_XLIB)
42+
$(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS)
43+
$(STRIP) $@

‎demos/hello/32/makefile‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
SOURCES := hello.c
6+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
7+
TGT = hello
8+
9+
# the below 4 vars must be named exactly like here
10+
DJCFLAGS = -Wall -ggdb3
11+
DJCPPFLAGS = -I. -I$(srcdir)
12+
OBJECTS = $(notdir $(SOURCES:.c=.o))
13+
14+
all: $(TGT)
15+
16+
clean: clean_dj32
17+
$(RM) $(TGT)
18+
19+
# display info about the built executable
20+
info: $(TGT)
21+
djstubify -i $<
22+
23+
run: $(TGT)
24+
dosemu -dumb -l $(realpath $<)
25+
26+
# hook in dj64 - make sure to not do that before defining `all:` target
27+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
28+
ifeq ($(wildcard $(DJMK)),)
29+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
30+
$(error dj32 not installed)
31+
endif
32+
clean_dj32:
33+
else
34+
include $(DJMK)
35+
endif
36+
37+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
38+
$(TGT): $(DJ64_XLIB)
39+
cp $< $@

‎demos/helloasm/32/makefile‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
STRIP = @true
6+
# or use `STRIP = djstrip` for non-debug build
7+
8+
SOURCES := hello.c thunks_a.c thunks_c.c thunks_p.c
9+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
10+
AS_SOURCES := h.S
11+
AS_SOURCES := $(addprefix $(srcdir)/,$(AS_SOURCES))
12+
TGT = helloasm.exe
13+
14+
# the below 4 vars must be named exactly like here
15+
DJCFLAGS = -Wall -ggdb3
16+
DJCPPFLAGS = -I. -I$(srcdir)
17+
DJASCPPFLAGS = -I$(srcdir)
18+
DJASFLAGS = -I. -I$(srcdir)
19+
OBJECTS = $(notdir $(SOURCES:.c=.o))
20+
AS_OBJECTS = $(notdir $(AS_SOURCES:.S=.o))
21+
PDHDR = $(srcdir)/asm.h
22+
GLOB_ASM = $(srcdir)/glob_asm.h
23+
24+
all: $(TGT)
25+
26+
clean: clean_dj32
27+
$(RM) $(TGT)
28+
29+
# display info about the built executable
30+
info: $(TGT)
31+
djstubify -i $<
32+
33+
run: $(TGT)
34+
dosemu -dumb $<
35+
36+
# hook in dj64 - make sure to not do that before defining `all:` target
37+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
38+
ifeq ($(wildcard $(DJMK)),)
39+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
40+
$(error dj32 not installed)
41+
endif
42+
clean_dj32:
43+
else
44+
include $(DJMK)
45+
endif
46+
47+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
48+
$(TGT): $(DJ64_XLIB)
49+
$(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS)
50+
$(STRIP) $@

‎demos/helloasm/makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CFLAGS = -Wall -ggdb3
1010
OBJECTS = $(SOURCES:.c=.o)
1111
AS_OBJECTS = $(AS_SOURCES:.S=.o)
1212
PDHDR = asm.h
13+
GLOB_ASM = glob_asm.h
1314

1415
all: $(TGT)
1516

‎demos/int86/32/makefile‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
STRIP = @true
6+
# or use `STRIP = djstrip` for non-debug build
7+
8+
SOURCES := file.c
9+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
10+
TGT = file.exe
11+
12+
# the below 4 vars must be named exactly like here
13+
DJCFLAGS = -Wall -ggdb3
14+
DJCPPFLAGS = -I. -I$(srcdir)
15+
OBJECTS = $(notdir $(SOURCES:.c=.o))
16+
17+
all: $(TGT)
18+
19+
clean: clean_dj32
20+
$(RM) $(TGT)
21+
22+
# display info about the built executable
23+
info: $(TGT)
24+
djstubify -i $<
25+
26+
run: $(TGT)
27+
dosemu -t $<
28+
29+
# hook in dj64 - make sure to not do that before defining `all:` target
30+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
31+
ifeq ($(wildcard $(DJMK)),)
32+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
33+
$(error dj32 not installed)
34+
endif
35+
clean_dj32:
36+
else
37+
include $(DJMK)
38+
endif
39+
40+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
41+
$(TGT): $(DJ64_XLIB)
42+
$(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS)
43+
$(STRIP) $@

‎demos/makefile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ NOSTATIC = hello
77

88
all:
99
set -e; $(foreach D,$(DEMOS),$(MAKE) -C $(D);)
10+
set -e; $(foreach D,$(DEMOS),$(MAKE) -C $(D)/32;)
1011

1112
static:
1213
set -e; $(foreach D,$(filter-out $(NOSTATIC),$(DEMOS)),$(MAKE) -C $(D) static;)
@@ -16,14 +17,17 @@ djgpp/%:
1617

1718
clean:
1819
$(foreach D,$(DEMOS),$(MAKE) -C $(D) clean;)
20+
$(foreach D,$(DEMOS),$(MAKE) -C $(D)/32 clean;)
1921

2022
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
2123

2224
src_install: clean djgpp/clean
2325
$(foreach D,$(DEMOS),\
2426
$(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/dj64/demos/$(D);\
25-
$(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/dj64/demos/$(D)/djgpp;)
26-
$(foreach F,$(filter-out %/djgpp,$(call rwildcard,$(DEMOS),*)),\
27+
$(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/dj64/demos/$(D)/32;\
28+
$(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/dj64/demos/$(D)/djgpp;\
29+
)
30+
$(foreach F,$(filter-out %/djgpp %/32,$(call rwildcard,$(DEMOS),*)),\
2731
$(INSTALL) -m 0644 $(F) $(DESTDIR)$(prefix)/share/doc/dj64/demos/$(F);)
2832

2933
src_uninstall:

‎demos/rmcb/32/makefile‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
srcdir = ..
2+
vpath %.c $(srcdir)
3+
vpath %.S $(srcdir)
4+
5+
STRIP = @true
6+
# or use `STRIP = djstrip` for non-debug build
7+
8+
SOURCES := main.c mouse.c thunks_a.c thunks_c.c
9+
SOURCES := $(addprefix $(srcdir)/,$(SOURCES))
10+
AS_SOURCES := ms.S asm.S
11+
AS_SOURCES := $(addprefix $(srcdir)/,$(AS_SOURCES))
12+
TGT = rmcb.exe
13+
14+
# the below 4 vars must be named exactly like here
15+
DJCFLAGS = -Wall -ggdb3
16+
DJCPPFLAGS = -I. -I$(srcdir)
17+
DJASCPPFLAGS = -I$(srcdir)
18+
DJASFLAGS = -I. -I$(srcdir)
19+
OBJECTS = $(notdir $(SOURCES:.c=.o))
20+
AS_OBJECTS = $(notdir $(AS_SOURCES:.S=.o))
21+
PDHDR = $(srcdir)/asm.h
22+
GLOB_ASM = $(srcdir)/glob_asm.h
23+
24+
all: $(TGT)
25+
26+
clean: clean_dj32
27+
$(RM) $(TGT)
28+
29+
# display info about the built executable
30+
info: $(TGT)
31+
djstubify -i $<
32+
33+
run: $(TGT)
34+
dosemu -t $<
35+
36+
# hook in dj64 - make sure to not do that before defining `all:` target
37+
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
38+
ifeq ($(wildcard $(DJMK)),)
39+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
40+
$(error dj32 not installed)
41+
endif
42+
clean_dj32:
43+
else
44+
include $(DJMK)
45+
endif
46+
47+
# dj64 sets `DJ64_XOBJS`, `DJ64_XLIB`, `DJ64_XLDFLAGS`
48+
$(TGT): $(DJ64_XLIB)
49+
$(LINK) -d $@.dbg $^ -o $@ $(DJ64_XLDFLAGS)
50+
$(STRIP) $@

‎demos/rmcb/makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CFLAGS = -Wall -ggdb3
1010
OBJECTS = $(SOURCES:.c=.o)
1111
AS_OBJECTS = $(AS_SOURCES:.S=.o)
1212
PDHDR = asm.h
13+
GLOB_ASM = glob_asm.h
1314

1415
all: $(TGT)
1516

0 commit comments

Comments
 (0)