From 05bfce99d698664fd4d7b8e8518d346e09e0814b Mon Sep 17 00:00:00 2001 From: Sylvain PILLOT Date: Tue, 13 Feb 2024 19:56:28 +0100 Subject: [PATCH] added a better mechanism for differentiating compilation of modules between FxCG50 and fx9860G --- ports/fx9860g3/Makefile | 1 + ports/fxcg50/Makefile | 1 + ports/sh/Makefile | 29 +++++++++++++++++++++++------ ports/sh/numworks/ion.c | 4 ---- ports/sh/numworks/modkandinsky.c | 4 ---- ports/sh/numworks/time.c | 4 ---- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/ports/fx9860g3/Makefile b/ports/fx9860g3/Makefile index a49a16024..a34f28323 100644 --- a/ports/fx9860g3/Makefile +++ b/ports/fx9860g3/Makefile @@ -1,6 +1,7 @@ include ../../py/mkenv.mk SH_CFLAGS := -DFX9860G +TARGETCASIO := "FX9860G" SH_LDFLAGS := -T fx9860g.ld -ljustui-fx -lm -lgint-fx -lc -lgint-fx -lgcc SH_ASSETS := \ diff --git a/ports/fxcg50/Makefile b/ports/fxcg50/Makefile index 1d0e8f40f..a527c3ff8 100644 --- a/ports/fxcg50/Makefile +++ b/ports/fxcg50/Makefile @@ -1,6 +1,7 @@ include ../../py/mkenv.mk SH_CFLAGS := -DFXCG50 +TARGETCASIO := "FXCG50" SH_LDFLAGS := -T fxcg50.ld -ljustui-cg -lm -lgint-cg -lc -lgint-cg -lgcc SH_ASSETS := img_modifier_states.png font_9.png font_13.png font_19.png PoliceNW.png diff --git a/ports/sh/Makefile b/ports/sh/Makefile index 06d049a53..ccaca7464 100644 --- a/ports/sh/Makefile +++ b/ports/sh/Makefile @@ -15,9 +15,6 @@ SRC_C = \ ports/sh/debug.c \ ports/sh/keymap.c \ ports/sh/modcasioplot.c \ - ports/sh/numworks/modkandinsky.c \ - ports/sh/numworks/ion.c \ - ports/sh/numworks/time.c \ ports/sh/modgint.c \ ports/sh/mphalport.c \ ports/sh/objgintimage.c \ @@ -30,13 +27,33 @@ SRC_C = \ SRC_QSTR += \ ports/sh/main.c \ ports/sh/modcasioplot.c \ - ports/sh/numworks/modkandinsky.c \ - ports/sh/numworks/ion.c \ - ports/sh/numworks/time.c \ ports/sh/modgint.c \ ports/sh/objgintimage.c \ ports/sh/pyexec.c \ + +ifeq ($(TARGETCASIO),"FXCG50") + $(info ************ FXCG50 VERSION ************ ) + $(info ********* Add Numworks modules ********* ) + SRC_C += \ + ports/sh/numworks/modkandinsky.c \ + ports/sh/numworks/ion.c \ + ports/sh/numworks/time.c \ + + SRC_QSTR += \ + ports/sh/numworks/modkandinsky.c \ + ports/sh/numworks/ion.c \ + ports/sh/numworks/time.c + + +endif + +ifeq ($(TARGETCASIO),"FX9860G") + $(info *********** FX9860G VERSION *********** ) + +endif + + ASSETS_O := $(SH_ASSETS:%=$(BUILD)/sh_assets/%.o) OBJ = $(PY_O) $(ASSETS_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) diff --git a/ports/sh/numworks/ion.c b/ports/sh/numworks/ion.c index 19aa6af7d..8cf09bd9d 100644 --- a/ports/sh/numworks/ion.c +++ b/ports/sh/numworks/ion.c @@ -1,5 +1,3 @@ -#ifdef FXCG50 - //---------------------------------------------------------------------------// // ____ PythonExtra // //.-'`_ o `;__, A community port of MicroPython for CASIO calculators. // @@ -204,5 +202,3 @@ const mp_obj_module_t ion_module = { }; MP_REGISTER_MODULE(MP_QSTR_ion, ion_module); - -#endif // FXCG50 \ No newline at end of file diff --git a/ports/sh/numworks/modkandinsky.c b/ports/sh/numworks/modkandinsky.c index 63677d2ee..c44593b89 100644 --- a/ports/sh/numworks/modkandinsky.c +++ b/ports/sh/numworks/modkandinsky.c @@ -1,5 +1,3 @@ -#ifdef FXCG50 - //---------------------------------------------------------------------------// // ____ PythonExtra // //.-'`_ o `;__, A community port of MicroPython for CASIO calculators. // @@ -320,5 +318,3 @@ const mp_obj_module_t kandinsky_module = { }; MP_REGISTER_MODULE(MP_QSTR_kandinsky, kandinsky_module); - -#endif //FXCG50 \ No newline at end of file diff --git a/ports/sh/numworks/time.c b/ports/sh/numworks/time.c index 157c1eaee..debcdd0ec 100644 --- a/ports/sh/numworks/time.c +++ b/ports/sh/numworks/time.c @@ -1,5 +1,3 @@ -#ifdef FXCG50 - //---------------------------------------------------------------------------// // ____ PythonExtra // //.-'`_ o `;__, A community port of MicroPython for CASIO calculators. // @@ -111,5 +109,3 @@ const mp_obj_module_t time_module = { }; MP_REGISTER_MODULE(MP_QSTR_time, time_module); - -#endif //FXCG50 \ No newline at end of file