mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add bsp
This commit is contained in:
parent
e5caa03adf
commit
a7fc5eea90
74
bsp/Makefile-win-mingw/Makefile
Normal file
74
bsp/Makefile-win-mingw/Makefile
Normal file
@ -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
bsp/Makefile-win-mingw/PikaPython/main.py
Normal file
7
bsp/Makefile-win-mingw/PikaPython/main.py
Normal file
@ -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
Normal file
BIN
bsp/Makefile-win-mingw/PikaPython/pikaPackage.exe
Normal file
Binary file not shown.
2
bsp/Makefile-win-mingw/PikaPython/requestment.txt
Normal file
2
bsp/Makefile-win-mingw/PikaPython/requestment.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pikascript-core
|
||||||
|
PikaStdLib
|
4
bsp/Makefile-win-mingw/README.md
Normal file
4
bsp/Makefile-win-mingw/README.md
Normal file
@ -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
bsp/Makefile-win-mingw/main.c
Normal file
6
bsp/Makefile-win-mingw/main.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "pikaScript.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
PikaObj* pikaMain = pikaScriptInit();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user