summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorroot <root@t60.home.remexre.com>2024-11-18 10:45:20 -0600
committerroot <root@t60.home.remexre.com>2024-11-18 10:45:20 -0600
commit62e41dcb40d0450d493a804e7f0ac3e32f35aabf (patch)
tree0744f1af53ac605868d8b85cd5446264820a4ca1 /src/Makefile
parent943a6597b2bcd1b3ed208458a5cba61ad5b4051c (diff)
Adds Linux support.
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/Makefile b/src/Makefile
index 07f1cb5..0f4841b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,3 @@
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
-endif
-
SRCS = $(sort $(wildcard $(srcdir)/*.c))
OBJS = $(patsubst $(srcdir)/%.c,obj/%.o,$(SRCS))
DEPS = $(patsubst $(srcdir)/%.c,obj/%.d,$(SRCS))
@@ -10,11 +6,9 @@ CFLAGS =
CPPFLAGS =
LDFLAGS =
-CC = $(DEVKITPRO)/devkitARM/bin/arm-none-eabi-gcc
-
-CFLAGS_AUTO = -D__3DS__ -ffunction-sections -flto -g -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -mword-relocations -O3 -std=c11 -Wall -Werror=implicit-function-declaration
-LDFLAGS_AUTO = -L$(DEVKITPRO)/libctru/lib -specs=3dsx.specs
-LDLIBS_AUTO = -lctru -lm
+CFLAGS_AUTO = -fdata-sections -ffunction-sections -flto -g -O3 -std=c11 -Wall -Werror=implicit-function-declaration
+LDFLAGS_AUTO =
+LDLIBS_AUTO = -lm
CFLAGS_ALL = $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)
LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
@@ -30,15 +24,9 @@ all:
else
-all: imb3.3dsx
-3dslink: imb3.3dsx
- $(DEVKITPRO)/tools/bin/3dslink $<
-.PHONY: 3dslink
-
-imb3.3dsx: imb3.elf
- 3dsxtool $< $@
+include $(srcdir)/platform/$(platform).mk
-imb3.elf: $(OBJS) obj/gc/gc.o obj/platform/3ds.o
+imb3.elf: $(OBJS) obj/gc/gc.o obj/platform/$(platform).o
$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -o $@ $^ $(LDLIBS_ALL)
obj/%.o: $(srcdir)/%.c