mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 03:48:05 +11:00
bc1496a7e3
It was a bad idea to remove it. Now that I'm introducing the concept of a per-app glue file, it becomes much easier to build emulated zasm as a userspace app.
49 lines
1.3 KiB
Makefile
49 lines
1.3 KiB
Makefile
TARGETS = shell/shell zasm/zasm runbin/runbin
|
|
KERNEL_HEADERS = shell/kernel.h zasm/kernel.h
|
|
USER_HEADERS = zasm/user.h
|
|
CFSPACK = ../cfspack/cfspack
|
|
KERNEL = ../../kernel
|
|
APPS = ../../apps
|
|
|
|
.PHONY: all
|
|
all: $(TARGETS)
|
|
|
|
shell/kernel.h: shell/shell_.asm
|
|
zasm/kernel.h: zasm/glue.asm
|
|
$(KERNEL_HEADERS):
|
|
scas -o - -I $(KERNEL) $< | ./bin2c.sh KERNEL | tee $@ > /dev/null
|
|
|
|
zasm/user.h: $(APPS)/zasm/glue.asm
|
|
$(USER_HEADERS):
|
|
scas -o - -I $(APPS) $< | ./bin2c.sh USERSPACE | tee $@ > /dev/null
|
|
|
|
zasm/includes.cfs: $(CFSPACK)
|
|
rm -rf zasm/includes
|
|
cp -r $(KERNEL) zasm/includes
|
|
cp -r $(APPS)/zasm zasm/includes/zasm
|
|
find zasm/includes -name *.md -o -name *.example -delete
|
|
find zasm/includes -type f -exec sed -i -e 's/;.*//g' {} \;
|
|
cp user.h zasm/includes
|
|
$(CFSPACK) zasm/includes > $@
|
|
rm -rf zasm/includes
|
|
|
|
zasm/includes.h: zasm/includes.cfs
|
|
./bin2c.sh FSDEV < $< | tee $@ > /dev/null
|
|
|
|
shell/shell: shell/shell.c libz80/libz80.o shell/kernel.h $(CFSPACK)
|
|
zasm/zasm: zasm/zasm.c libz80/libz80.o zasm/kernel.h zasm/user.h zasm/includes.h
|
|
runbin/runbin: runbin/runbin.c libz80/libz80.o
|
|
$(TARGETS):
|
|
cc $< libz80/libz80.o -o $@
|
|
|
|
libz80/libz80.o: libz80/z80.c
|
|
make -C libz80/codegen opcodes
|
|
gcc -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
|
|
|
|
$(CFSPACK):
|
|
make -C ../cfspack
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f $(TARGETS) $(KERNEL_HEADERS) $(USER_HEADERS) zasm/includes.*
|