Since picobit-vm.h can now contain code (with LESS_MACROS), separate
authorVincent St-Amour <stamourv@iro.umontreal.ca>
Sat, 25 Jul 2009 01:58:28 +0000 (24 21:58 -0400)
committerVincent St-Amour <stamourv@iro.umontreal.ca>
Sat, 25 Jul 2009 01:58:28 +0000 (24 21:58 -0400)
compilation does not work anymore. Separate compilation is therefore
not used for the moment.

makefile
picobit-vm.c
primitives.c

index c03b130..624c3d0 100644 (file)
--- a/makefile
+++ b/makefile
@@ -2,8 +2,12 @@
 
 all: picobit-vm
 
-picobit-vm: picobit-vm.o gc.o bignums.o debug.o primitives.o dispatch.o
-       cc -o picobit-vm picobit-vm.o gc.o bignums.o debug.o primitives.o dispatch.o # -lpcap
+# picobit-vm: picobit-vm.o gc.o bignums.o debug.o primitives.o dispatch.o
+#      cc -o picobit-vm picobit-vm.o gc.o bignums.o debug.o primitives.o dispatch.o # -lpcap
+
+# TODO separate compilation does not work for the moment, see picobit-vm.c for details
+picobit-vm: picobit-vm.c gc.c bignums.c debug.c primitives.c dispatch.c picobit-vm.h
+       cc -o picobit-vm picobit-vm.c
 
 .c.o:
        $(CC) -O -c $*.c
@@ -28,11 +32,11 @@ debug-gc:
        make picobit-vm
 
 mcc18: picoboard2.c picobit-vm.c gc.c bignums.c debug.c primitives.c dispatch.c picobit-vm.h
-       wine ~/.wine/drive_c/MCC18/bin/mcc18.exe -DMCC18 -I=C:/MCC18/h -p=18f4550 picoboard2.c
+       wine ~/.wine/drive_c/MCC18/bin/mcc18.exe -DMCC18 -DLESS_MACROS -I=C:/MCC18/h -p=18f4550 picoboard2.c
        wine ~/.wine/drive_c/MCC18/bin/mplink.exe -lC:/MCC18/lib -mpicoboard2.map picoboard2.lkr picoboard2.o -o picoboard2.hex
 
 hi_tech_c: picobit-vm.c gc.c bignums.c debug.c primitives.c dispatch.c picobit-vm.h
-       picc18 -DHI_TECH_C --chip=18F4550 picobit-vm.c
+       picc18 -DHI_TECH_C -DLESS_MACROS --chip=18F4550 picobit-vm.c
 
 clean:
        rm -f *.o *~ picobit-vm
index ca7a8c0..d7ba1f5 100644 (file)
@@ -283,14 +283,16 @@ int read_hex_file (char *filename)
 
 /*---------------------------------------------------------------------------*/
 
-#ifdef ROBOT
+/* #ifdef ROBOT */
+// TODO since picobit-vm.h can now contain code (with LESS_MACROS), including
+// the header in each results in multiple definitions of these functions.
 // no separate compilation
 #include "debug.c"
 #include "gc.c"
 #include "bignums.c"
 #include "primitives.c"
 #include "dispatch.c"
-#endif
+/* #endif */
 
 /*---------------------------------------------------------------------------*/
 
index ec890cf..af10b44 100644 (file)
@@ -746,7 +746,7 @@ void prim_clock () {
 void prim_motor () {
   decode_2_int_args ();
 
-  if (a1 < 1 || a1 > 2 || a2 < -100 || a2 > 100)
+  if (a1 < 1 || a1 > 2 || a2 < -100 || a2 > 100) // TODO since we now use undigned values, we can't go backwards anymore
     ERROR("motor", "argument out of range");
 
 #ifdef  PICOBOARD2