Skip to content

Commit

Permalink
moved all source to src/, .o files to build/
Browse files Browse the repository at this point in the history
  • Loading branch information
mist64 committed Apr 4, 2021
1 parent 5a4741c commit 61fc63d
Show file tree
Hide file tree
Showing 68 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ x16emu.exe
x16emu_mac.zip
x16emu_win.zip
x16-rom
rom_labels.h
src/rom_labels.h
rom.bin
chargen.bin
.vscode/
Expand Down
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ else
SDL2CONFIG=sdl2-config
endif

CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Iextern/include -Iextern/src
CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include -Isrc/extern/src
LDFLAGS=$(shell $(SDL2CONFIG) --libs) -lm

ODIR = build
SDIR = src


ifdef TRACE
CFLAGS+=-D TRACE
Expand All @@ -39,21 +42,25 @@ ifdef EMSCRIPTEN
OUTPUT=x16emu.html
endif

OBJS = cpu/fake6502.o memory.o disasm.o video.o ps2.o i2c.o smc.o rtc.o via.o loadsave.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o icon.o timing.o
_OBJS = cpu/fake6502.o memory.o disasm.o video.o ps2.o i2c.o smc.o rtc.o via.o loadsave.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o icon.o timing.o

_HEADERS = audio.h cpu/65c02.h cpu/fake6502.h cpu/instructions.h cpu/mnemonics.h cpu/modes.h cpu/support.h cpu/tables.h debugger.h disasm.h extern/include/gif.h extern/src/ym2151.h glue.h i2c.h icon.h joystick.h keyboard.h loadsave.h memory.h ps2.h rendertext.h rom_symbols.h rtc.h sdcard.h smc.h timing.h utf8.h utf8_encode.h vera_pcm.h vera_psg.h vera_spi.h version.h via.h video.h

HEADERS = audio.h cpu/65c02.h cpu/fake6502.h cpu/instructions.h cpu/mnemonics.h cpu/modes.h cpu/support.h cpu/tables.h debugger.h disasm.h extern/include/gif.h extern/src/ym2151.h glue.h i2c.h icon.h joystick.h keyboard.h loadsave.h memory.h ps2.h rendertext.h rom_labels.h rom_symbols.h rtc.h sdcard.h smc.h timing.h utf8.h utf8_encode.h vera_pcm.h vera_psg.h vera_spi.h version.h via.h video.h
_OBJS += extern/src/ym2151.o
_HEADERS += extern/src/ym2151.h

OBJS += extern/src/ym2151.o
HEADERS += extern/src/ym2151.h
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
HEADERS = $(patsubst %,$(SDIR)/%,$(_HEADERS))

ifneq ("$(wildcard ./rom_labels.h)","")
HEADERS+=rom_labels.h
ifneq ("$(wildcard ./src/rom_labels.h)","")
HEADERS+=src/rom_labels.h
endif


all: $(OBJS) $(HEADERS)
$(CC) -o $(OUTPUT) $(OBJS) $(LDFLAGS)
%.o: %.c
$(ODIR)/%.o: $(SDIR)/%.c
@mkdir -p $$(dirname $@)
$(CC) $(CFLAGS) -c $< -o $@

cpu/tables.h cpu/mnemonics.h: cpu/buildtables.py cpu/6502.opcodes cpu/65c02.opcodes
Expand Down Expand Up @@ -152,4 +159,4 @@ package_linux:
rm -rf $(TMPDIR_NAME)

clean:
rm -f *.o cpu/*.o extern/src/*.o x16emu x16emu.exe x16emu.js x16emu.wasm x16emu.data x16emu.worker.js x16emu.html x16emu.html.mem
rm -rf $(ODIR) x16emu x16emu.exe x16emu.js x16emu.wasm x16emu.data x16emu.worker.js x16emu.html x16emu.html.mem
2 changes: 1 addition & 1 deletion rom_symbols.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
for i in ndx keyd fa vartab fnlen fnadr status sa; do
echo "#define" `echo $i | tr '[:lower:]' '[:upper:]'` 0x`cat ../x16-rom/build/x16/kernal.sym ../x16-rom/build/x16/basic.sym | grep -w $i | head -n 1 | cut -d " " -f 2`;
done > rom_symbols.h
done > src/rom_symbols.h
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 61fc63d

Please sign in to comment.