Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ZIP_URL ?=
ZIP_URL_DOWNLOAD_OUTPUT ?= /tmp/godot-lua-pluginscript-unzip-to-build.zip


CFLAGS += -std=c11 "-I$(CURDIR)/lib/godot-headers" "-I$(CURDIR)/lib/high-level-gdnative" "-I$(CURDIR)/lib/luajit/src"
CFLAGS += -std=c11 -Ilib/godot-headers -Ilib/high-level-gdnative -Ilib/luajit/src
ifeq ($(DEBUG), 1)
CFLAGS += -g -O0 -DDEBUG
else
Expand Down Expand Up @@ -133,8 +133,6 @@ $(BUILD_FOLDERS):

build/%/language_gdnative.o: src/language_gdnative.c lib/high-level-gdnative/hgdn.h
$(_CC) -o $@ $< -c $(CFLAGS)
build/%/language_in_editor_callbacks.o: src/language_in_editor_callbacks.c
$(_CC) -o $@ $< -c $(CFLAGS)

$(MAKE_LUAJIT_OUTPUT): | build/%/luajit build/jit
$(MAKE) -C $(firstword $|) $(and $(TARGET_SYS),TARGET_SYS=$(TARGET_SYS)) $(MAKE_LUAJIT_ARGS)
Expand Down Expand Up @@ -199,6 +197,11 @@ build/lua_pluginscript.zip: $(LUASRCDIET_DEST) $(DIST_DEST)
build/project.godot: src/tools/project.godot | build
cp $< $@

build/compile_commands.json: COMPILE_COMMAND = $(_CC) -o build/language_gdnative.o src/language_gdnative.c -c $(CFLAGS)
build/compile_commands.json: Makefile
echo '[{"directory":"$(CURDIR)","file":"src/language_gdnative.c","command":"$(subst ",\",$(COMPILE_COMMAND))"}]' > $@


# Phony targets
.PHONY: clean dist docs set-version unzip-to-build
clean:
Expand Down Expand Up @@ -230,6 +233,9 @@ native-luajit: MACOSX_DEPLOYMENT_TARGET ?= 11.0
native-luajit: MAKE_LUAJIT_ARGS = MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)
native-luajit: build/native/luajit/src/luajit.o

compilation-database: build/compile_commands.json
compdb: compilation-database

# Targets by OS + arch
linux32: MAKE_LUAJIT_ARGS += CC="$(CC) -m32 -fPIC"
linux32: CFLAGS += -m32 -fPIC
Expand Down