mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-07 14:53:34 +00:00
Planning on using the new Ultraleap OpenXR API layer. It's possible that this will be added back if that doesn't work out.
96 lines
3.5 KiB
Plaintext
96 lines
3.5 KiB
Plaintext
include_rules
|
|
|
|
# core
|
|
ifneq (@(PICO),y)
|
|
SRC += src/main.c
|
|
endif
|
|
SRC += src/core/arr.c
|
|
SRC += src/core/fs.c
|
|
SRC += src/core/map.c
|
|
ifneq (@(PICO),y)
|
|
SRC += src/core/os_$(PLATFORM).c
|
|
endif
|
|
SRC += src/core/png.c
|
|
SRC += src/core/ref.c
|
|
SRC += src/core/utf.c
|
|
SRC += src/core/util.c
|
|
SRC += src/core/zip.c
|
|
|
|
# modules
|
|
SRC_@(AUDIO) += src/modules/audio/*.c
|
|
SRC_@(DATA) += src/modules/data/*.c
|
|
SRC_@(EVENT) += src/modules/event/*.c
|
|
SRC_@(FILESYSTEM) += src/modules/filesystem/*.c
|
|
SRC_@(GRAPHICS) += src/modules/graphics/*.c
|
|
SRC_@(HEADSET) += src/modules/headset/headset.c
|
|
SRC_@(HEADSET)@(SIMULATOR) += src/modules/headset/headset_desktop.c
|
|
SRC_@(HEADSET)@(OPENVR) += src/modules/headset/headset_openvr.c
|
|
SRC_@(HEADSET)@(OPENXR) += src/modules/headset/headset_openxr.c
|
|
SRC_@(HEADSET)@(OCULUS) += src/modules/headset/headset_oculus.c
|
|
SRC_@(HEADSET)@(VRAPI) += src/modules/headset/headset_vrapi.c
|
|
SRC_@(HEADSET)@(PICO) += src/modules/headset/headset_pico.c
|
|
SRC_@(HEADSET)@(WEBXR) += src/modules/headset/headset_webxr.c
|
|
SRC_@(MATH) += src/modules/math/*.c
|
|
SRC_@(PHYSICS) += src/modules/physics/*.c
|
|
SRC_@(THREAD) += src/modules/thread/*.c
|
|
SRC_@(TIMER) += src/modules/timer/*.c
|
|
|
|
# lib
|
|
SRC += src/lib/stb/*.c
|
|
SRC_@(DATA) += src/lib/jsmn/jsmn.c
|
|
SRC_@(GRAPHICS) += src/lib/glad/glad.c
|
|
SRC_@(MATH) += src/lib/noise1234/noise1234.c
|
|
SRC_@(THREAD) += src/lib/tinycthread/tinycthread.c
|
|
|
|
# api
|
|
SRC += src/api/api.c
|
|
SRC += src/api/l_lovr.c
|
|
SRC_@(AUDIO) += src/api/l_audio*.c
|
|
SRC_@(DATA) += src/api/l_data*.c
|
|
SRC_@(EVENT) += src/api/l_event*.c
|
|
SRC_@(FILESYSTEM) += src/api/l_filesystem*.c
|
|
SRC_@(GRAPHICS) += src/api/l_graphics*.c
|
|
SRC_@(HEADSET) += src/api/l_headset*.c
|
|
SRC_@(MATH) += src/api/l_math*.c
|
|
SRC_@(PHYSICS) += src/api/l_physics*.c
|
|
SRC_@(THREAD) += src/api/l_thread*.c
|
|
SRC_@(TIMER) += src/api/l_timer*.c
|
|
SRC_@(JSON) += src/lib/lua-cjson/*.c
|
|
SRC_@(ENET) += src/lib/lua-enet/*.c
|
|
|
|
# resources
|
|
RES += src/resources/boot.lua
|
|
RES += src/resources/VarelaRound.ttf
|
|
RES_@(OPENVR) += src/resources/*.json
|
|
SRC_@(GRAPHICS) += src/resources/shaders.c
|
|
|
|
## build:
|
|
# 1 [XD] resources -> bin headers
|
|
# 2 [CC] compile .c -> .o
|
|
# 3 [LD] link .o -> exe
|
|
# 4 [CP] copy external libs -> libs folder
|
|
: foreach $(RES) $(RES_y) |> !xd |> %f.h
|
|
: foreach $(SRC) $(SRC_y) $(SRC_yy) | src/resources/*.h |> !cc |> .obj/%B.o
|
|
: .obj/*.o $(STATIC_LIBS) $(STATIC_LIBS_y) |> !ld |> $(PREFIX)lovr$(SUFFIX) | $(EXTRAS) $(EXTRAS_y)
|
|
: foreach $(LIBS) |> !cp |> $(LIB)/%b
|
|
|
|
# Android
|
|
ifeq ($(PLATFORM),android)
|
|
# There needs to be a Java class for the activity with 2 lines of code to load native libraries.
|
|
# It gets compiled to a class file with javac and then into bytecode using dx
|
|
CLASS = org/lovr/app/Activity.class
|
|
: src/resources/$(ACTIVITY_y).java |> !cp |> src/resources/Activity.java
|
|
: src/resources/Activity.java |> ^ JAVAC %b^ javac -classpath $(CLASSPATH) -d . %f |> $(CLASS)
|
|
: $(CLASS) $(EXTRA_JARS) |> !dx |> classes.dex
|
|
|
|
# Create an apk from the Android manifest. The zip command is used afterwards to add raw files
|
|
# because it is way faster than calling aapt again and apks are just zips (TODO windows).
|
|
: $(ANDROID_MANIFEST_y) |> !cp |> src/resources/AndroidManifest.xml
|
|
: src/resources/AndroidManifest.xml | $(LIB)/*.so classes.dex |> ^ AAPT %b^ aapt package -F %o -M %f -I $(ANDROID_JAR) $(ANDROID_ASSETS) && zip -qu0 %o $(LIB)/*.so classes.dex |> tmp/lovr.unaligned.apk
|
|
|
|
# Even though we have an apk, it isn't actually valid yet. It has to be aligned using the special
|
|
# zipalign tool, and then signed using apksigner.
|
|
: tmp/lovr.unaligned.apk |> !zipalign |> tmp/lovr.unsigned.apk
|
|
: tmp/lovr.unsigned.apk |> !apksigner |> lovr.apk
|
|
endif
|