Makefile modified to build Lua.

But it isn't being used just yet...
alentours-dev
q3k 2012-08-23 16:11:41 +02:00
parent 58a49b7ffb
commit 8d01b60ba2
5 changed files with 23 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
Kernel/obj
Kernel/kernel.bin
Kernel/src/Lua/*.o
Kernel/src/Lua/liblua.a
Kernel/dump
Loader/obj
Loader/loader.bin

View File

@ -67,9 +67,16 @@ Tier0: $(TIER0)
#TIER1 := $(foreach i, $(TIER1OBJ), obj/$(i))
#Tier1: $(TIER1)
kernel.bin: version-gen Tier0
src/Lua/liblua.a:
@echo "[i] Building Lua..."
@make -C src/Lua
LUA := src/Lua/liblua.a
Lua: $(LUA)
kernel.bin: version-gen Tier0 Lua
@echo "[i] Linking kernel.bin..."
@$(LD) -T src/kernel.ld -o kernel.bin $(TIER0) $(TIER1)
@$(LD) -T src/kernel.ld -o kernel.bin $(TIER0) $(TIER1) $(LUA)
hdd.img: kernel.bin
@echo "[i] Creating HDD image..."
@ -101,6 +108,7 @@ emulate: hdd.img
clean:
@rm -Rf obj
@make -C src/Lua clean
@if [ -e kernel.bin ] ; then rm kernel.bin ; fi
@if [ -e hdd_temp.img ] ; then rm hdd_temp.img ; fi
@if [ -e hdd.img ] ; then rm hdd.img; fi

View File

@ -5,7 +5,7 @@
#include "Tier0/kstdlib.h"
const char *strchr (const char *str, int character);
inline int strcmp(const char *s1, const char *s2);
int strcmp(const char *s1, const char *s2);
char *strpbrk(const char *s1, const char *s2);
char *strerror(int errnum);
char *strstr(const char *haystack, const char *needle);

View File

@ -12,7 +12,7 @@ LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
AR= ar rcu
RANLIB= ranlib
RANLIB= /usr/xdev/bin/x86_64-elf-ranlib
RM= rm -f
SYSCFLAGS=
@ -98,8 +98,16 @@ ansi:
bsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
CUCUMBERCFLAGS:=-m64 -mcmodel=large -Wall -nostdlib -nostartfiles -nodefaultlibs -std=c99 -g
CUCUMBERCFLAGS+=-I ./include -Wno-packed-bitfield-compat -O2 -fno-optimize-sibling-calls -mcmodel=kernel
CUCUMBERCFLAGS+= -mno-red-zone -ffreestanding
%.o:
@echo "[i] [Lua] Compiling $*.c..."
@$(CC) $(CFLAGS) -c $*.c -o $*.o
cucumber-kernel:
$(MAKE) $(ALL_O) SYSCFLAGS="-DLUA_ANSI -I\"../../include/Lua/\" -I\"../../include/\""
$(MAKE) $(LUA_A) SYSCFLAGS="-DLUA_ANSI -I\"../../include/Lua/\" -I\"../../include/\" $(CUCUMBERCFLAGS)"
freebsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"

View File

@ -119,6 +119,7 @@ l_noret luaD_throw (lua_State *L, int errcode) {
abort();
}
}
__builtin_unreachable();
}