Implement elfloader/module support

This commit is contained in:
M4xw
2018-08-07 16:53:58 +02:00
committed by root
parent 71c4e2c155
commit 8b0915cb01
20 changed files with 1542 additions and 46 deletions

31
modules/sample/Makefile Normal file
View File

@@ -0,0 +1,31 @@
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
include $(DEVKITARM)/base_rules
TARGET := module_sample
BUILD := ../../build_ipl
OUTPUT := ../../output
OBJS = $(addprefix $(BUILD)/,\
module_sample.o \
)
LD = $(DEVKITPRO)/devkitARM/bin/arm-none-eabi-ld
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
CUSTOMDEFINES := -D__arm__ -DARM
CFLAGS = $(ARCH) -O2 -nostdlib -std=gnu11 -fpie -Wall $(CUSTOMDEFINES)
LDFLAGS = $(ARCH) -nostartfiles -lgcc
.PHONY: clean all
all: $(TARGET).so
$(BUILD)/%.o: ./%.c
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET).so: $(BUILD)/$(TARGET).o
$(LD) $(LDLAGS) -pie -entry _pluginInit $(BUILD)/$(TARGET).o -o $(OUTPUT)/$(TARGET).so
clean:
@rm -rf $(OUTPUT)/$(TARGET).so

View File

@@ -0,0 +1,10 @@
/* Sample Hekate Module
2018 - M4xw
*/
#include "../../common/common_module.h"
void _pluginInit(cbMainModule_t cb, pmoduleConfiguration_t mc)
{
cb("Hello World!");
}