save before makefile switch
This commit is contained in:
parent
92c2063e49
commit
4ab334ff16
5 changed files with 42 additions and 20 deletions
3
Depfile
3
Depfile
|
@ -4,6 +4,9 @@ TempDir=obj
|
||||||
SourceDir=asm src
|
SourceDir=asm src
|
||||||
Files=trainscript/trainscript.y trainscript/trainscript.l trainscript/tsvm.cpp
|
Files=trainscript/trainscript.y trainscript/trainscript.l trainscript/tsvm.cpp
|
||||||
|
|
||||||
|
LexUseCpp
|
||||||
|
YaccUseCpp
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
AS=gcc
|
AS=gcc
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
50
Makefile.new
50
Makefile.new
|
@ -1,6 +1,7 @@
|
||||||
# Makefile generated by makedep.
|
# Makefile generated by makedep.
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
|
RM = rm
|
||||||
AS = gcc
|
AS = gcc
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
@ -12,7 +13,7 @@ YACC = bison
|
||||||
SRCS_AS = asm/intr_common_handler.S asm/multiboot.S asm/start.S
|
SRCS_AS = asm/intr_common_handler.S asm/multiboot.S asm/start.S
|
||||||
SRCS_CC = src/console.c src/init.c src/interrupts.c src/malloc.c src/pmm.c src/stdlib.c src/timer.c src/vmm.c
|
SRCS_CC = src/console.c src/init.c src/interrupts.c src/malloc.c src/pmm.c src/stdlib.c src/timer.c src/vmm.c
|
||||||
SRCS_CXX = trainscript/tsvm.cpp src/cplusplus.cpp src/vm.cpp obj/trainscript.yy.cpp obj/trainscript.tab.cpp
|
SRCS_CXX = trainscript/tsvm.cpp src/cplusplus.cpp src/vm.cpp obj/trainscript.yy.cpp obj/trainscript.tab.cpp
|
||||||
OBJS = obj/trainscript.o obj/trainscript.o obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
OBJS = obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
FLAGS = -m32 -Dnullptr=0
|
FLAGS = -m32 -Dnullptr=0
|
||||||
|
@ -24,49 +25,53 @@ LDFLAGS = -g -m32 -nostdlib -fno-builtin -Tkernel.ld
|
||||||
# Targets
|
# Targets
|
||||||
all: kernel
|
all: kernel
|
||||||
|
|
||||||
kernel: obj/trainscript.o obj/trainscript.o obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
.PHONY: clean
|
||||||
$(LD) $(FLAGS) $(LDFLAGS) -o $@ obj/trainscript.o obj/trainscript.o obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
clean:
|
||||||
|
$(RM) obj/trainscript.yy.cpp obj/trainscript.tab.cpp obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
||||||
|
|
||||||
|
kernel: obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
||||||
|
$(LD) $(FLAGS) $(LDFLAGS) -o $@ obj/tsvm.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/vm.o obj/trainscript.yy.o obj/trainscript.tab.o
|
||||||
|
|
||||||
# src/console.c
|
# src/console.c
|
||||||
obj/console.o: src/console.c include/console.h include/stdlib.h \
|
obj/console.o: src/console.c include/console.h include/stdlib.h \
|
||||||
include/varargs.h
|
include/varargs.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/console.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/console.c
|
||||||
|
|
||||||
# src/init.c
|
# src/init.c
|
||||||
obj/init.o: src/init.c include/kernel.h include/stdlib.h include/varargs.h \
|
obj/init.o: src/init.c include/kernel.h include/stdlib.h include/varargs.h \
|
||||||
include/console.h include/interrupts.h include/cpustate.h include/pmm.h \
|
include/console.h include/interrupts.h include/cpustate.h include/pmm.h \
|
||||||
include/multiboot.h include/vmm.h include/timer.h
|
include/multiboot.h include/vmm.h include/timer.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/init.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/init.c
|
||||||
|
|
||||||
# src/interrupts.c
|
# src/interrupts.c
|
||||||
obj/interrupts.o: src/interrupts.c include/interrupts.h include/cpustate.h \
|
obj/interrupts.o: src/interrupts.c include/interrupts.h include/cpustate.h \
|
||||||
include/console.h include/stdlib.h include/varargs.h include/io.h \
|
include/console.h include/stdlib.h include/varargs.h include/io.h \
|
||||||
src/intr_stubs.h
|
src/intr_stubs.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/interrupts.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/interrupts.c
|
||||||
|
|
||||||
# src/malloc.c
|
# src/malloc.c
|
||||||
obj/malloc.o: src/malloc.c include/stdlib.h include/varargs.h
|
obj/malloc.o: src/malloc.c include/stdlib.h include/varargs.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/malloc.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/malloc.c
|
||||||
|
|
||||||
# src/pmm.c
|
# src/pmm.c
|
||||||
obj/pmm.o: src/pmm.c include/pmm.h include/multiboot.h include/kernel.h \
|
obj/pmm.o: src/pmm.c include/pmm.h include/multiboot.h include/kernel.h \
|
||||||
include/stdlib.h include/varargs.h include/console.h
|
include/stdlib.h include/varargs.h include/console.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/pmm.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/pmm.c
|
||||||
|
|
||||||
# src/stdlib.c
|
# src/stdlib.c
|
||||||
obj/stdlib.o: src/stdlib.c include/stdlib.h include/varargs.h \
|
obj/stdlib.o: src/stdlib.c include/stdlib.h include/varargs.h \
|
||||||
include/kernel.h
|
include/kernel.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/stdlib.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/stdlib.c
|
||||||
|
|
||||||
# src/timer.c
|
# src/timer.c
|
||||||
obj/timer.o: src/timer.c include/timer.h include/interrupts.h \
|
obj/timer.o: src/timer.c include/timer.h include/interrupts.h \
|
||||||
include/cpustate.h
|
include/cpustate.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/timer.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/timer.c
|
||||||
|
|
||||||
# src/vmm.c
|
# src/vmm.c
|
||||||
obj/vmm.o: src/vmm.c include/vmm.h include/pmm.h include/multiboot.h \
|
obj/vmm.o: src/vmm.c include/vmm.h include/pmm.h include/multiboot.h \
|
||||||
include/stdlib.h include/varargs.h include/console.h include/kernel.h
|
include/stdlib.h include/varargs.h include/console.h include/kernel.h
|
||||||
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/vmm.c
|
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/vmm.c
|
||||||
|
|
||||||
# trainscript/tsvm.cpp
|
# trainscript/tsvm.cpp
|
||||||
obj/tsvm.o: trainscript/tsvm.cpp include/stdlib.h include/varargs.h \
|
obj/tsvm.o: trainscript/tsvm.cpp include/stdlib.h include/varargs.h \
|
||||||
|
@ -75,25 +80,32 @@ obj/tsvm.o: trainscript/tsvm.cpp include/stdlib.h include/varargs.h \
|
||||||
include/ker/dictionary.hpp include/ker/pair.hpp trainscript/typeid.hpp \
|
include/ker/dictionary.hpp include/ker/pair.hpp trainscript/typeid.hpp \
|
||||||
trainscript/trainscript.tab.hpp trainscript/trainscript.l.h \
|
trainscript/trainscript.tab.hpp trainscript/trainscript.l.h \
|
||||||
include/string.h
|
include/string.h
|
||||||
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c trainscript/tsvm.cpp
|
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c trainscript/tsvm.cpp
|
||||||
|
|
||||||
# src/cplusplus.cpp
|
# src/cplusplus.cpp
|
||||||
obj/cplusplus.o: src/cplusplus.cpp include/stdlib.h include/varargs.h \
|
obj/cplusplus.o: src/cplusplus.cpp include/stdlib.h include/varargs.h \
|
||||||
include/console.h include/ker/new.hpp
|
include/console.h include/ker/new.hpp
|
||||||
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/cplusplus.cpp
|
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/cplusplus.cpp
|
||||||
|
|
||||||
# src/vm.cpp
|
# src/vm.cpp
|
||||||
obj/vm.o: src/vm.cpp include/stdlib.h include/varargs.h \
|
obj/vm.o: src/vm.cpp include/stdlib.h include/varargs.h \
|
||||||
src/../trainscript/tsvm.hpp include/console.h include/ker/string.hpp \
|
src/../trainscript/tsvm.hpp include/console.h include/ker/string.hpp \
|
||||||
include/ker/vector.hpp include/ker/new.hpp include/ker/dictionary.hpp \
|
include/ker/vector.hpp include/ker/new.hpp include/ker/dictionary.hpp \
|
||||||
include/ker/pair.hpp src/../trainscript/typeid.hpp
|
include/ker/pair.hpp src/../trainscript/typeid.hpp
|
||||||
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/vm.cpp
|
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/vm.cpp
|
||||||
|
|
||||||
# obj/trainscript.yy.cpp
|
# obj/trainscript.yy.cpp
|
||||||
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c obj/trainscript.yy.cpp
|
obj/trainscript.yy.o: obj/trainscript.yy.cpp include/string.h \
|
||||||
|
include/stdlib.h include/varargs.h trainscript/common.h \
|
||||||
|
trainscript/tsvm.hpp include/console.h include/ker/string.hpp \
|
||||||
|
include/ker/vector.hpp include/ker/new.hpp include/ker/dictionary.hpp \
|
||||||
|
include/ker/pair.hpp trainscript/typeid.hpp \
|
||||||
|
trainscript/trainscript.tab.hpp
|
||||||
|
$(CXX) -iquotetrainscript $(FLAGS) $(CXXFLAGS) -o $@ -c obj/trainscript.yy.cpp
|
||||||
|
|
||||||
# obj/trainscript.tab.cpp
|
# obj/trainscript.tab.cpp
|
||||||
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c obj/trainscript.tab.cpp
|
obj/trainscript.tab.o: obj/trainscript.tab.cpp
|
||||||
|
$(CXX) -iquotetrainscript $(FLAGS) $(CXXFLAGS) -o $@ -c obj/trainscript.tab.cpp
|
||||||
|
|
||||||
# asm/intr_common_handler.S
|
# asm/intr_common_handler.S
|
||||||
obj/intr_common_handler.o: asm/intr_common_handler.S
|
obj/intr_common_handler.o: asm/intr_common_handler.S
|
||||||
|
@ -107,3 +119,9 @@ obj/multiboot.o: asm/multiboot.S
|
||||||
obj/start.o: asm/start.S
|
obj/start.o: asm/start.S
|
||||||
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/start.S
|
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/start.S
|
||||||
|
|
||||||
|
obj/trainscript.yy.cpp: trainscript/trainscript.l
|
||||||
|
$(LEX) --header-file=trainscript/trainscript.l.h -o obj/trainscript.yy.cpp -d trainscript/trainscript.l
|
||||||
|
|
||||||
|
obj/trainscript.tab.cpp: trainscript/trainscript.l
|
||||||
|
$(YACC) -o trainscript/trainscript.l.h -d obj/trainscript.tab.cpp
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ void kprintf(const char *format, ...)
|
||||||
kputs(itoa(i, buffer, 16));
|
kputs(itoa(i, buffer, 16));
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
f = va_arg(vl, float);
|
f = va_arg(vl, double);
|
||||||
kputs(ftoa(f, buffer, 3));
|
kputs(ftoa(f, buffer, 3));
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
|
|
|
@ -15,7 +15,7 @@ VAR global : INT;
|
||||||
PUB main() | i : INT
|
PUB main() | i : INT
|
||||||
BEGIN
|
BEGIN
|
||||||
print(10, 20, 30);
|
print(10, 20, 30);
|
||||||
afraid(15.0, 34) → i;
|
afraid(15, 34) → i;
|
||||||
print(40, i, 60);
|
print(40, i, 60);
|
||||||
0 -> i;
|
0 -> i;
|
||||||
WHILE i < 5 DO
|
WHILE i < 5 DO
|
||||||
|
@ -147,7 +147,7 @@ Variable NativeMethod::invoke(Vector<Variable> arguments)
|
||||||
return mkvar((Int)result);
|
return mkvar((Int)result);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" uint32_t __attribute__((cdecl)) cCodeFunction(float a, int b)
|
extern "C" uint32_t __attribute__((cdecl)) cCodeFunction(int a, int b)
|
||||||
{
|
{
|
||||||
kprintf("a=%d, b=%d\n", a, b);
|
kprintf("a=%d, b=%d\n", a, b);
|
||||||
return 666;
|
return 666;
|
||||||
|
|
|
@ -52,7 +52,8 @@ DISTFILES += \
|
||||||
trainscript/trainscript.y \
|
trainscript/trainscript.y \
|
||||||
trainscript/file02.ts \
|
trainscript/file02.ts \
|
||||||
kernel.ld \
|
kernel.ld \
|
||||||
Depfile
|
Depfile \
|
||||||
|
Makefile.new
|
||||||
|
|
||||||
QMAKE_INCDIR =
|
QMAKE_INCDIR =
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue