Skip to content

Commit

Permalink
Code builds again
Browse files Browse the repository at this point in the history
  • Loading branch information
emoon committed Feb 1, 2024
1 parent 482180a commit 74aa93b
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ genblitter
gencomp
gencpu
genlinetoscr
winuae
quaesar
58 changes: 29 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
.PHONY: all clean

all: winuae
all: quaesar

# build68k

build68k: FORCE
$(MAKE) -f Makefile.build68k
$(MAKE) -f build/Makefile.build68k

cpudefs.cpp: build68k table68k
./build68k < table68k > $@
src/cpudefs.cpp: build68k src/table68k
./build68k < src/table68k > $@

generated += cpudefs.cpp
generated += src/cpudefs.cpp

# gencomp

gencomp: FORCE $(generated)
$(MAKE) -f Makefile.gencomp
$(MAKE) -f build/Makefile.gencomp

jit/comptbl.h: gencomp
src/jit/comptbl.h: gencomp
./gencomp

generated += jit/comptbl.h
generated += src/jit/comptbl.h

# gencpu

gencpu: FORCE $(generated)
$(MAKE) -f Makefile.gencpu
$(MAKE) -f build/Makefile.gencpu

cputbl.h: gencpu
./gencpu
src/cputbl.h: gencpu
cd src && ../gencpu && cd ..

generated += cputbl.h
generated += src/cputbl.h

# genblitter

genblitter: FORCE
$(MAKE) -f Makefile.genblitter

blit.h: genblitter
./genblitter i > $@
./genblitter i > src/$@
blitfunc.cpp: genblitter
./genblitter f > $@
./genblitter f > src/$@
blitfunc.h: genblitter
./genblitter h > $@
./genblitter h > src/$@
blittable.cpp: genblitter
./genblitter t > $@
./genblitter t > src/$@

generated += blit.h blitfunc.cpp blitfunc.h blittable.cpp
generated += src/blit.h src/blitfunc.cpp src/blitfunc.h src/blittable.cpp

# genlinetoscr

genlinetoscr: FORCE
$(MAKE) -f Makefile.genlinetoscr
$(MAKE) -f build/Makefile.genlinetoscr

linetoscr.cpp: genlinetoscr
./genlinetoscr > linetoscr.cpp
./genlinetoscr > src/linetoscr.cpp

generated += linetoscr.cpp
generated += src/linetoscr.cpp

# winuae
# quasar

winuae: FORCE $(generated)
$(MAKE) -f Makefile.winuae
quaesar: FORCE $(generated)
$(MAKE) -f build/Makefile.quaesar

# clean

clean:
make -f Makefile.build68k clean
make -f Makefile.genblitter clean
make -f Makefile.gencomp clean
make -f Makefile.gencpu clean
make -f Makefile.genlinetoscr clean
make -f Makefile.winuae clean
make -f build/Makefile.build68k clean
make -f build/Makefile.genblitter clean
make -f build/Makefile.gencomp clean
make -f build/Makefile.gencpu clean
make -f build/Makefile.genlinetoscr clean
make -f build/Makefile.quaesar clean
rm -rf out

FORCE: ;
4 changes: 2 additions & 2 deletions build/Makefile.build68k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ./build68k < table68k > cpudefs.cpp

target = build68k
srcs = build68k.cpp
srcs = src/build68k.cpp

include Makefile.inc
include build/Makefile.inc
4 changes: 2 additions & 2 deletions build/Makefile.genblitter
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# ./genblitter t > blittable.c

target = genblitter
srcs = blitops.cpp genblitter.cpp
srcs = src/blitops.cpp src/genblitter.cpp

include Makefile.inc
include build/Makefile.inc
4 changes: 2 additions & 2 deletions build/Makefile.gencomp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ./gencomp

target = gencomp
srcs = cpudefs.cpp jit/gencomp.cpp missing.cpp readcpu.cpp od-cross/unicode.cpp
srcs = src/cpudefs.cpp jit/gencomp.cpp src/missing.cpp src/readcpu.cpp od-cross/unicode.cpp

include Makefile.inc
include build/Makefile.inc

4 changes: 2 additions & 2 deletions build/Makefile.gencpu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ./gencpu

target = gencpu
srcs = cpudefs.cpp gencpu.cpp missing.cpp readcpu.cpp od-cross/unicode.cpp
srcs = src/cpudefs.cpp src/gencpu.cpp src/missing.cpp src/readcpu.cpp od-cross/unicode.cpp

include Makefile.inc
include build/Makefile.inc
4 changes: 2 additions & 2 deletions build/Makefile.genlinetoscr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ./genlinetoscr > linetoscr.cpp

target = genlinetoscr
srcs = genlinetoscr.cpp
srcs = src/genlinetoscr.cpp

include Makefile.inc
include build/Makefile.inc
28 changes: 28 additions & 0 deletions build/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CPPFLAGS += -g -DFSUAE -I . -I include -I od-cross -MMD

OUT=out/$(target)

objs = $(srcs:%.cpp=$(OUT)/%.o)
deps = $(objs:.o=.d)

# bash Create Dir rule
MD = mkdir -p $(1) > /dev/null

# Create output dirs
dirs:=$(sort $(OUT) $(patsubst %/,%,$(dir $(objs))))
$(foreach dir,$(dirs),$(shell $(call MD,$(dir))))

.PHONY: all clean

all: $(target)

clean:
rm -f $(objs) $(deps) $(target) -r $(OUT)

$(objs): $(OUT)/%.o : %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<

$(target) : $(objs)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

-include $(objs:.o=.d)
Loading

0 comments on commit 74aa93b

Please sign in to comment.