Compiling Lua January 06, 2010 02:50PM | Registered: 14 years ago Posts: 3 |
... lauxlib.c: In function 'luaL_loadfile': lauxlib.c:553: warning: implicit declaration of function 'fatInitDefault' make[2]: *** [lauxlib.o] Error 1 make[2]: Leaving directory '/c/luawii/lua/lua-5.1.3/src' make[1]: *** [generic] Error 2 make[1]: Leaving directory '/c/luawii/lua/lua-5.1.3/src' make: *** [generic] Error 2
Re: Compiling Lua January 06, 2010 10:16PM | Admin Registered: 15 years ago Posts: 5,132 |
#--------------------------------------------------------------------------------- # Clear the implicit built in rules #--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPPC)),) $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif include $(DEVKITPPC)/wii_rules #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := source DATA := data INCLUDES := #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- LIBS := -lpng -lz -logc -lm #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- LIBDIRS := #--------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional # rules for different file extensions #--------------------------------------------------------------------------------- ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- export OUTPUT := $(CURDIR)/$(TARGET) export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir)) export DEPSDIR := $(CURDIR)/$(BUILD) #--------------------------------------------------------------------------------- # automatically build a list of object files for our project #--------------------------------------------------------------------------------- CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- ifeq ($(strip $(CPPFILES)),) export LD := $(CC) else export LD := $(CXX) endif export OFILES := $(addsuffix .o,$(BINFILES)) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ $(sFILES:.s=.o) $(SFILES:.S=.o) #--------------------------------------------------------------------------------- # build a list of include paths #--------------------------------------------------------------------------------- export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) \ -I$(LIBOGC_INC) #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ -L$(LIBOGC_LIB) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @echo clean ... @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol #--------------------------------------------------------------------------------- install: @mkdir -p lib @mkdir -p include @cp $(OUTPUT).a lib/libwiisprite.a @cp source/*.h include/ realinstall: @cp $(OUTPUT).a $(LIBOGC_LIB)/libwiisprite.a @cp source/*.h $(LIBOGC_INC) #--------------------------------------------------------------------------------- run: wiiload $(TARGET).dol #--------------------------------------------------------------------------------- %.a: @echo linking to lib ... $(notdir $@) @$(AR) -rc $@ $^ #--------------------------------------------------------------------------------- else DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- $(OUTPUT).a: $(OFILES) #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #--------------------------------------------------------------------------------- %.jpg.o : %.jpg #--------------------------------------------------------------------------------- @echo $(notdir $<) $(bin2o) -include $(DEPENDS) #--------------------------------------------------------------------------------- endif #---------------------------------------------------------------------------------
Re: Compiling Lua January 07, 2010 08:31AM | Registered: 14 years ago Posts: 3 |
cd lua-5.1.3/ make make install cd .. make cp test.lua /mnt/to/your/sdcard wiiload lua.elf Basically that's all you have to do!
cd lua-5.1.3/ make
C:\lua>cd lua-5.1.3 C:\lua\lua-5.1.3>make cd src && make generic make[1]: Entering directory `/c/lua/lua-5.1.3/src' make all MYCFLAGS= make[2]: Entering directory `/c/lua/lua-5.1.3/src' /c/devkitPro/devkitPPC/bin/powerpc-gekko-gcc -O2 -mrvl -Wall -DGEKKO -mrvl -mcpu =750 -meabi -mhard-float -I/c/devkitPro/devkitPPC/include -c -o lapi.o lapi.c make[2]: /c/devkitPro/devkitPPC/bin/powerpc-gekko-gcc: Command not found make[2]: *** [lapi.o] Error 127 make[2]: Leaving directory `/c/lua/lua-5.1.3/src' make[1]: *** [generic] Error 2 make[1]: Leaving directory `/c/lua/lua-5.1.3/src' make: *** [generic] Error 2 C:\lua\lua-5.1.3>
CC= $(DEVKITPPC)/bin/powerpc-gekko-gcc
CC= $(DEVKITPPC)/bin/powerpc-eabi-gcc
In file included from lauxlib.c:14: c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eab i/include/fat.h:38:25: error: ogc/disc_io.h: No such file or directory In file included from lauxlib.c:14: c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eab i/include/fat.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' befo re 'fatInit' c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eab i/include/fat.h:51: error: expected '=', ',', ';', 'asm' or '__attribute__' befo re 'fatInitDefault' c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eab i/include/fat.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' befo re 'fatMountSimple' c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eab i/include/fat.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' befo re 'fatMount' lauxlib.c: In function 'luaL_loadfile': lauxlib.c:553: warning: implicit declaration of function 'fatInitDefault' make[2]: *** [lauxlib.o] Error 1 make[2]: Leaving directory `/c/lua/lua-5.1.3/src' make[1]: *** [generic] Error 2 make[1]: Leaving directory `/c/lua/lua-5.1.3/src' make: *** [generic] Error 2 C:\lua\lua-5.1.3>
LIBS=$(MACHDEP) -mrvl -L$(DEVKITPPC)/lib/wii -lfat -lwiiuse -lbte -logc -lm
Re: Compiling Lua January 07, 2010 12:32PM | Admin Registered: 15 years ago Posts: 5,132 |
Re: Compiling Lua January 07, 2010 03:20PM | Registered: 14 years ago Posts: 3 |
C:\lua\lua-5.1.3>make lua-5.1.3.a C:\lua\lua-5.1.3>
C:\lua>make main.c c:/lua/source/main.c: In function 'main': c:/lua/source/main.c:47: warning: suggest parentheses around operand of '!' or c hange '&' to '&&' or '!' to '~' c:/lua/source/main.c:55: warning: suggest parentheses around operand of '!' or c hange '&' to '&&' or '!' to '~' c:/lua/source/main.c:77: warning: implicit declaration of function 'sleep' linking ... lua.elf main.o: In function `main': c:/lua/source/main.c:43: undefined reference to `luaL_newstate' c:/lua/source/main.c:51: undefined reference to `luaL_openlibs' c:/lua/source/main.c:52: undefined reference to `luaL_loadfile' c:/lua/source/main.c:60: undefined reference to `lua_pcall' c:/lua/source/main.c:69: undefined reference to `lua_getfield' c:/lua/source/main.c:70: undefined reference to `lua_pcall' c:/lua/source/main.c:43: undefined reference to `luaL_newstate' c:/lua/source/main.c:73: undefined reference to `lua_tolstring' collect2: ld returned 1 exit status make[1]: *** [/c/lua/lua.elf] Error 1 make: *** [build] Error 2 C:\lua>
Re: Compiling Lua January 26, 2010 01:26PM | Registered: 15 years ago Posts: 30 |
Re: Compiling Lua January 26, 2010 04:33PM | Admin Registered: 15 years ago Posts: 5,132 |
Re: Compiling Lua January 26, 2010 09:36PM | Registered: 14 years ago Posts: 234 |
Re: Compiling Lua January 27, 2010 12:43AM | Admin Registered: 15 years ago Posts: 5,132 |