Implement elfloader/module support
This commit is contained in:
31
modules/sample/Makefile
Normal file
31
modules/sample/Makefile
Normal 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
|
||||
10
modules/sample/module_sample.c
Normal file
10
modules/sample/module_sample.c
Normal 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!");
|
||||
}
|
||||
Reference in New Issue
Block a user