unsigned 2 years ago
parent
commit
a7fc5eea90

+ 74 - 0
bsp/Makefile-win-mingw/Makefile

@@ -0,0 +1,74 @@
+#======================================================================================================================#
+CC_SRC  := $(wildcard *.c)
+CC_SRC  += $(wildcard PikaPython/pikascript-api/*.c)
+CC_SRC  += $(wildcard PikaPython/pikascript-core/*.c)
+CC_SRC  += $(wildcard PikaPython/pikascript-lib/PikaStdLib/*.c)
+
+CC_INC  := .
+CC_INC  += PikaPython/pikascript-api
+CC_INC  += PikaPython/pikascript-core
+
+#======================================================================================================================#
+PY_SRC  := $(wildcard PikaPython/*.py)
+
+#======================================================================================================================#
+OUT     :=  pika.exe
+
+#----------------------------------------------------------------------------------------------------------------------#
+CC      :=  gcc
+
+#----------------------------------------------------------------------------------------------------------------------#
+CCFLAG  +=  -std=gnu11 -O1 -MMD -g
+CCFLAG  +=  -ffunction-sections -fdata-sections
+CCFLAG  +=  -flto
+
+LDFLAG  +=  -Wl,--warn-common
+LDFLAG  +=  -Wl,--gc-sections
+LDFLAG  +=  -flto
+
+#======================================================================================================================#
+.DEFAULT_GOAL = all
+_Comma := ,
+
+ifneq ($(MAKECMDGOALS),clean)
+  ifeq (${wildcard obj},)
+    _NUL := ${shell mkdir obj}
+  endif
+
+  CC_OBJ := $(addprefix obj/,$(addsuffix .co,$(notdir $(CC_SRC))))
+
+  $(foreach obj,$(CC_SRC),$(eval obj/$(notdir $(obj)).co : $(obj)))
+
+  -include $(CC_OBJ:.co=.d)
+
+  CCSuffix := $(CCFLAG) $(addprefix -I,$(CC_INC)) $(addprefix -D,$(CC_DEF))
+  LDObject := $(CC_OBJ) $(addprefix -l,$(LD_LIB))
+  LDSuffix := $(LDFLAG) $(addprefix -Wl$(_Comma)-L,$(LD_INC))
+
+endif
+
+#======================================================================================================================#
+.PHONY: all
+all: $(OUT)
+	@echo Build Completed.
+
+#----------------------------------------------------------------------------------------------------------------------#
+PikaPython/pikascript-api/__asset_pikaModules_py_a.c : $(PY_SRC)
+	@cd PikaPython && ./rust-msc-latest-win10.exe
+
+#----------------------------------------------------------------------------------------------------------------------#
+$(OUT): $(CC_OBJ)
+	@$(CC) $(LDObject) $(LDSuffix) -o $(OUT)
+	@echo
+
+#----------------------------------------------------------------------------------------------------------------------#
+obj/%.co:
+	@echo Compile $(@F:.co=) ...
+	@$(CC) -c $< -o $@ $(CCSuffix)
+
+#----------------------------------------------------------------------------------------------------------------------#
+.PHONY: clean
+clean:
+	@-rm -f pika.exe
+	@-rm -rf ./obj
+	@echo Clean Completed.

+ 7 - 0
bsp/Makefile-win-mingw/PikaPython/main.py

@@ -0,0 +1,7 @@
+import PikaStdLib
+
+mem = PikaStdLib.MemChecker()
+print('hello PikaScript !')
+
+print('mem used max:')
+mem.max()

BIN
bsp/Makefile-win-mingw/PikaPython/pikaPackage.exe


+ 2 - 0
bsp/Makefile-win-mingw/PikaPython/requestment.txt

@@ -0,0 +1,2 @@
+pikascript-core
+PikaStdLib

+ 4 - 0
bsp/Makefile-win-mingw/README.md

@@ -0,0 +1,4 @@
+PikaPython for Windows mingw
+note: This bsp is made by the community, unofficially provided
+```make``` Compile use ```gcc```
+```make clean``` uses the ```rm``` command, if an error is reported that ```make: rm: Command not found``` , please manually delete the ```obj``` folder and ```pika.exe``` file

+ 6 - 0
bsp/Makefile-win-mingw/main.c

@@ -0,0 +1,6 @@
+#include "pikaScript.h"
+
+int main()
+{
+    PikaObj* pikaMain = pikaScriptInit();
+}