chiark / gitweb /
massive makefile rearrangements and improvements
authorian <ian>
Sun, 20 Nov 2005 23:57:41 +0000 (23:57 +0000)
committerian <ian>
Sun, 20 Nov 2005 23:57:41 +0000 (23:57 +0000)
24 files changed:
Makefile
cebpic/.cvsignore
cebpic/Makefile
cebpic/manypics.make
cebpic/merge-hex [new file with mode: 0755]
cebpic/morse-auto.fin [deleted file]
cebpic/morse-defs.inc [deleted file]
cebpic/morse-generator [moved from cebpic/morse-auto.asm-gen with 83% similarity]
cebpic/morse.messages [moved from cebpic/morse-auto.messages with 100% similarity]
detpic/.cvsignore
detpic/Makefile
detpic/common.inc
detpic/i2clib.asm
detpic/morse-auto.fin [deleted file]
detpic/morse-defs.inc [deleted file]
detpic/morse.messages [moved from detpic/morse-auto.messages with 97% similarity]
detpic/panic.inc
detpic/seriallib.inc [deleted file]
detpic/test-sofar.asm
detpic/variables.asm [deleted file]
hostside/Makefile
iwjpictest/Makefile
layout/Makefile
pic.make

index 8eb1034a6242bdf94d99dd059079e8219a29ff79..39bf7c0507d2992f168097550886c6f98c5ea2e1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,27 @@
 
-all:           pic hostprogs
+recurse = set -e; for f in $($(1)_DIRS); do $(MAKE) -C $$f $(2); done
 
-PICPROGS_DIRS= iwjpictest cebpic detpic
-HOSTPROGS_DIRS=        layout hostside
+PIC_DIRS=      iwjpictest cebpic detpic
+HOST_DIRS=     layout hostside
+
+all:
+       $(call recurse,HOST,recurse)
+       $(call recurse,PIC,)
+
+host: host_recurse
+
+host_%:
+       $(call recurse,HOST,$*)
 
 pic:
-               set -e; for f in $(PICPROGS_DIRS); do $(MAKE) -C $$f; done
+       $(MAKE) -C layout for-pic
+       $(call recurse,PIC,)
 
 pic_%:
-               set -e; for f in $(PICPROGS_DIRS); do $(MAKE) -C $$f $*; done
+       $(MAKE) -C layout for-pic
+       $(call recurse,PIC,$*)
+
+pic_clean:
+       $(call recurse,PIC,clean)
 
-hostprogs:
-               set -e; for f in $(HOSTPROGS_DIRS); do $(MAKE) -C $$f; done
+clean:         host_clean pic_clean
index c0c7dd7f62f9386999f4e01777b4e462856c0fab..13f1d6283d32f5567b5e1c57d2c0bcca359bf183 100644 (file)
@@ -1,10 +1,12 @@
-*.hex
+*+morse.asm
 *.cod
+*.hex
 *.lst
 *.map
-idlocs*.asm
+.submakefile
+blank[0246].asm
 gpsim.log
-routines.lib
-morse-auto.asm
-morse-auto.inc
+idlocs*.asm
+morse+auto.inc
 ours-pindata.asm
+routines.lib
index 5bd22592a765933830b8eee752f6ff0156620dfc..0a9ea5ea5e94cfa0eeaab833844d2f10aefc508e 100644 (file)
@@ -1,18 +1,17 @@
-PROGRAMS=      led-flash send-serial panic reply-serial        \
-               nmra-stream nmra-stream,slow tblrd_test \
-               i2c-test i2c-test,slow
-# booster-output-low  -disabled because you forgot to cvs add it
 
-INCLUDES=      common.inc morse-auto.inc ../iwjpictest/insn-aliases.inc
-LIBS=          routines.lib                            
+CEBPIC=                ./
 PICNOS=                0 1 3
 
-include manypics.make
+PROGRAMS=      led-flash send-serial panic reply-serial        \
+               nmra-stream nmra-stream,slow tblrd_test         \
+               i2c-test i2c-test,slow
 
 ROUTINES=      routines-led
+LIBS=          routines.lib                            
 
-clean:         manypic-clean
-               rm -f routines.lib
+INCLUDES=      common.inc pindata.inc
+
+include manypics.make
 
 routines.lib:  $(addsuffix .o, $(ROUTINES))
                rm -f $@.new
@@ -25,3 +24,6 @@ i2c-test-reply,slow.hex: i2c-test-reply,slow.o morse-auto.o
 
 %,slow.o:      %.asm
                $(ASSEMBLE) -D SLOW_VERSION -c -o $@ $<
+
+clean:         manypic-clean
+               rm -f routines.lib
index 0fe7178540bdc79f4b16f2e59e4f2baeb3c3e60f..9dbb08558f42c758216bb49f13c5b2e7e8c24205 100644 (file)
@@ -1,21 +1,79 @@
 
+default: all
+
+#---------- bizarre macro arrangements for $(PROGRAMS) ----------
+
+define define_prog
+
+TARGETS += $(1)+code.hex $(1)+program.hex $(1)+program.map
+TARGETS += $$(foreach i, $$(PICNOS), $(1)+entire$$i.hex)
+
+$(1)_CODEHEX= $$(foreach panel, $$(XCODEN_$(1)), $(1)+$$(panel).hex) \
+               $$(foreach panel, $$(XCODE1_$(1)), $$(panel).hex)
+
+$(1)+code.hex: $(1)+program.hex $($(1)_CODEHEX)
+               $$(MERGEHEX)
+
+$(1)+entire%.hex: $(1)+program.hex $($(1)_CODEHEX) idlocs%.hex config.hex
+               $$(MERGEHEX)
+
+$(1)+program.hex: $(1).o $(OBJS_$(prog)) $(LIBS)
+               $$(LINK)
+
+endef
+
+define define_directasm
+
+$(1).hex:      $(1).asm
+               $$(ASSEMBLE) $$<
+endef
+
+define makesubmakefile
+set -e; d=.submakefile.new; rm -f $$d; for f in "$$@";do echo "$$f" >>$$d; done
+--
+$(foreach prog, $(PROGRAMS), $(call define_prog,$(prog)))
+$(foreach da, idlocs% config %+morse blank%, $(call define_directasm,$(da)))
+endef
+
+.submakefile:  $(CEBPIC)manypics.make Makefile
+               : $(shell $(makesubmakefile)) ... generate .submakefile
+               @mv -f $@.new $@
+
+ifneq ($(MAKECMDGOALS),clean)
+include .submakefile
+endif
+
+blank0.asm blank2.asm blank4.asm blank6.asm: blank%.asm: $(CEBPIC)manypics.make
+               echo >$@.new " org 0x$*000"
+               echo >>$@.new " nop"
+               echo >>$@.new " end"
+               mv -f $@.new $@
+
+#---------- general definitions etc. ----------
+
+TARGETS += $(foreach i, $(PICNOS), idlocs$i.hex noncode$i.hex)
+MORSE_INCLUDE ?= common.inc
+INCLUDES += ../iwjpictest/insn-aliases.inc morse+auto.inc
+MERGEHEX= $(CEBPIC)merge-hex $^ $o
+
 include ../common.make
 include ../pic.make
 
-perpic%.hex:   config.o idlocs%.o
-               $(LINK)
+#---------- targets ----------
 
-morse-auto.inc:        $(CEBPIC)morse-auto.asm-gen morse-auto.messages
-               ./$^ inc $o
+all: $(TARGETS)
 
-%-automorse.asm: $(CEBPIC)morse-auto.asm-gen morse-auto.messages %-bare.map
-               ./$^ asm $o
+noncode%.hex:  idlocs%.hex config.hex
+               $(MERGEHEX)
+
+morse+auto.inc:        $(CEBPIC)morse-generator morse.messages
+               ./$^ inc $o
 
-%-bare.map:    %.o $(LIBS)
-               gplink -m -o $*-bare.hex $^
+%+morse.asm:   $(CEBPIC)morse-generator morse.messages %+program.map
+               ./$^ asm -I$(MORSE_INCLUDE) $o
 
-%-entire0.hex: %.o config.o idlocs0.o $(LIBS) $(DEFLIBS)
-               $(LINK)
+%.map:         %.hex
+               @:
 
 idlocs%.asm:   $(CEBPIC)make-idlocs
                ./$< $* >$@.new && mv -f $@.new $@
@@ -24,6 +82,6 @@ ours-pindata.asm: ../layout/ours-pindata.asm
                cp $< $@
 
 manypic-clean: pic-clean
-               rm -f idlocs*.asm *.map *-automorse.*
+               rm -f idlocs*.asm *+morse.* morse+auto.inc blank[0246].*
 
-.PRECIOUS:     idlocs%.asm %-bare.map %-automorse.asm
+.PRECIOUS:     idlocs%.asm morse+auto.inc %+morse.asm %+morse.hex %.map
diff --git a/cebpic/merge-hex b/cebpic/merge-hex
new file mode 100755 (executable)
index 0000000..03df2d3
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+$end= ':00000001FF';
+while (<>) {
+    chomp;
+    next if uc $_ eq $end;
+    print or die $!;
+    print "\n" or die $!;
+}
+print $end or die $!;
+print "\n" or die $!;
diff --git a/cebpic/morse-auto.fin b/cebpic/morse-auto.fin
deleted file mode 100644 (file)
index 9bbe3c4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-; stub file
diff --git a/cebpic/morse-defs.inc b/cebpic/morse-defs.inc
deleted file mode 100644 (file)
index 420d28f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-       include common.inc
similarity index 83%
rename from cebpic/morse-auto.asm-gen
rename to cebpic/morse-generator
index e30b21e10ab2bdeb63d1adfc2195881af6d0a1ea..ebf0830fc64595973e5a87f1b8d9ad92196d5afe 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
-# Converts morse-auto.messages to morse-auto.asm or morse-auto.inc.
-# morse.asm specifies some flash contents, as follows:
+# Converts morse.messages to *+morse.asm or morse+auto.inc.
+# morse-auto.asm specifies some flash contents, as follows:
 #
 # Each message XY produces a symbol
 #   morse_XY
 # should also arrange to define any symbolic addresse referred to
 # in morse-auto.messages, eg by including the pXXXX.inc.
 #
-# morse-auto.asm contains the actual source and morse-auto.inc
-# contains `extern' references for the labels morse_XY.
+# *+morse.asm contains the actual source and morse+auto.inc
+# contains `equ' definitions for the addresses morse_XY.
 
 use IO::File;
 use IO::Handle;
 
 sub badusage () {
     die ("usages:\n".
-        " morse-auto.asm-gen <input>... asm\n".
-        " morse-auto.asm-gen <input>... [<file>.map] inc\n");
+        " morse-generator <input>... asm\n".
+        " morse-generator <input>... [<file>.map] inc\n");
 }
 
 @ARGV or badusage();
+
+$includefile= 'morse-defs.inc';
+if ($ARGV[$#ARGV] =~ s/^\-I//) {
+    $includefile= pop @ARGV;
+}
+
 $which= pop @ARGV;
 $which eq 'asm' or $which eq 'inc' or badusage();
 
@@ -52,7 +58,7 @@ while (<DATA>) {
     $morse{$let}= $morse;
 }
 
-sub oops ($) { die "morse-auto.asm-gen: $ARGV:$.: $_[0]\n"; }
+sub oops ($) { die "morse-generator: $ARGV:$.: $_[0]\n"; }
 
 $mapfile= $ARGV[$#ARGV];
 
@@ -70,7 +76,7 @@ if ($mapfile =~ m/\.map$/) {
        ($sym,$val,$progdata,$staticext,$filename) = ($1,$2,$3,$4,$5);
        next if $progdata ne 'data';
        $filename =~ s/\.asm$//;
-       $sym= "$filename:$sym" if $staticext eq 'static';
+       $sym= $staticext eq 'static' ? "$filename:$sym" : "::$sym";
        $symval{$sym}= $val;
     }
     die "$0: $mapfile: $!\n" if $maph->error;
@@ -83,14 +89,14 @@ print <<'END' or die $!
 END
     ;
 
-print <<'END' or die $!
-
-       include morse-defs.inc
-       include morse-auto.inc
+print <<END or die $!
 
+       include $includefile
        radix dec
 
+xxx_unknown_xxx equ     0
 morse_section  org     morse_messages_start
+
 END
     if $which eq 'asm';
 
@@ -124,10 +130,9 @@ while (<>) {
     unshift @data, sprintf "0x%x%x", scalar(@addrs), $morse_bytes;
     push @data, map {
        s/^\:/ $filename.':' /e;
-       $filename= $1 if m/^(.+)\:/;
-       (exists $symval{$_} ? $symval{$_} :
-        "$_ - (0xf00 * !(($_ & 0xf00)^0xf00))");
-       
+       $filename= $1 if m/^([^:]+)\:/;
+       $_ = $symval{$_} if exists $symval{$_};
+       m/\:/ ? ' xxx_unknown_xxx' : "$_ - (0xf00 * !(($_ & 0xf00)^0xf00))"
     } @addrs;
 
     push @data, ('0') x (3 - (scalar(@data) + 3) % 4);
index 349455e894106f706c677b96785a2b967ba8896e..043209ef937e0be32b33e88656036dd1864e6eb9 100644 (file)
@@ -1,10 +1,11 @@
-*.hex
+*+morse.asm
 *.cod
+*.hex
 *.lst
 *.map
-*-automorse.asm
-idlocs*.asm
+.submakefile
+blank[0246].asm
 gpsim.log
-morse-auto.asm
-morse-auto.inc
+idlocs*.asm
+morse+auto.inc
 ours-pindata.asm
index a0bf895d9e87dc6961e0468c0934b105a8704f63..04d3e90f71349b2c668e858218fbe33867450f77 100644 (file)
@@ -1,12 +1,19 @@
-PROGRAMS=      test-sofar
-INCLUDES=      common.inc final.inc morse-auto.inc \
-               ../iwjpictest/insn-aliases.inc
-LIBS=          vectors.o panic.o routines-led.o variables.o i2clib.o
-DEFLIBS=       test-sofar-automorse.o
-PICNOS=                0 1 2
+
 CEBPIC=                ../cebpic/
-TARGETS=       $(addsuffix -bare.map, $(PROGRAMS)) \
-               $(foreach i, $(PICNOS), perpic$i.hex)           
+PICNOS=                0 1 2
+
+PROGRAMS=              test-sofar
+OBJS_test-sofar=       vectors.o panic.o routines-led.o i2clib.o
+XCODEN_test-sofar=     morse
+XCODE1_test-sofar=     blank2 blank6
+
+INCLUDES=      common.inc              \
+               final.inc               \
+               i2clib.inc              \
+               panic.fin               \
+               panic.inc               \
+               routines-led.fin        \
+               vectors.fin
 
 include                $(CEBPIC)manypics.make
 
index 9f229585fff965e31afa258f115f5ab81127176b..f6388f808419378bbbb06bf268402e87335a9e83 100644 (file)
@@ -1,15 +1,13 @@
 ; common macros & equs etc.
 
 ;**********************************************************************
-; boilerplate.inc
-;  Include this at the top of each file.
-;  Does the following things:
-;   includes the PIC18F458 definitions file (register and bit names)
-;   switches to decimal by default
+; common.inc
+; Generally include this at the top of each file.
 
         include         /usr/share/gputils/header/p18f458.inc
         radix           dec 
        include         panic.inc
+       include         morse+auto.inc
        include         ../iwjpictest/insn-aliases.inc
 
 ;****************************************************************************
index d90803f1f9fa9cb60228cad0126723e952140a5b..f0a25658ca24a506669510bd534744412135f066 100644 (file)
@@ -7,6 +7,7 @@
  radix dec
  include ../iwjpictest/insn-aliases.inc
  include panic.inc
+ include morse+auto.inc
 
 ;======================================================================
 ; NOTATION
diff --git a/detpic/morse-auto.fin b/detpic/morse-auto.fin
deleted file mode 100644 (file)
index d15603a..0000000
+++ /dev/null
@@ -1 +0,0 @@
- include final.inc
diff --git a/detpic/morse-defs.inc b/detpic/morse-defs.inc
deleted file mode 100644 (file)
index 00a54bd..0000000
+++ /dev/null
@@ -1 +0,0 @@
- include common.inc
similarity index 97%
rename from detpic/morse-auto.messages
rename to detpic/morse.messages
index 6b5b820f6f0a44d4096308380c407e306ec7452d..54847f6bb80121d46701ad831b58ed764fbd3f5d 100644 (file)
@@ -30,6 +30,8 @@ TI4                           ; for iwj
 TI5                            ; for iwj
 X      test-sofar:ch           ; bad character received from host
 
+Z      ::nonexistent_variable  ; test message
+
 # Messages for i2clib, S*
 SM     i2clib:st,:sspstat,:sspcon1,:sspcon2 ; m.,i., ctrlr bad state
 SS     i2clib:st,:sspstat,:sspcon1     ; slave, intr, controller bad state
index 1cff68a447be74fb67a725572162317057d20bf5..82920d60f62217df2a7f1342c9c09a6b11501161 100644 (file)
@@ -11,5 +11,3 @@ panic macro message
 ; Area filled in by morse-auto.asm (see morse-auto.asm-gen for details)
 morse_messages_start    equ     0x4000
 morse_messages_end      equ     0x4400
-
- include morse-auto.inc
diff --git a/detpic/seriallib.inc b/detpic/seriallib.inc
deleted file mode 100644 (file)
index 98af2e6..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-;######################################################################
-; seriallib.inc - SERIAL LIBRARY - DECLARATIONS AND DOCUMENTATION
-;
-;============================================================
-; GENERAL INFORMATION
-
-; Purpose:
-; --------
-;
-; This library allows the PIC to communicate with the host via the
-; PIC's UART, configured for RS232 at 9600 8N1.  It implements
-; unidirectional flow control: the host may ask the PIC not to
-; transmit, but not vice versa.
-
-; Naming scheme:
-; --------------
-;
-;  serial_...  are for use by the rest of the program and
-;               are the entrypoints which enable use of the serial port
-;  serialu_... must be defined in the rest of the program
-;               with the functionality and behaviour described.
-
-; At all times following serial_init, the serial hardware in the PIC is
-; completely reserved to the routines defined in seriallib.asm.  Nothing
-; else is allowed to read or modify the PIC UART state.
-
-; Use of PORTB, RBIF etc.:
-; ------------------------
-;
-; The seriallib makes use of the PORTB `interrupt on change' feature,
-; and expects at all times after serial_init to have exclusive use of
-; that feature, including the RBIF flag.  Only seriallib is allowed to
-; make reads of PORTB directly; the main program must call
-; serial_portb_read instead.  The main program may freely write to
-; LATB.
-;
-; If any of RB5, RB6 or RB7 is an output which would be electrically
-; floating if left in tristate (Z state) by the PIC then before
-; calling serial_init the main program must have configured the
-; appropriate TRISB bit(s) as outputs - presumably, after having
-; configured the corresponding LATB bit(s).  This will avoid excessive
-; interrupts resulting from floating values.
-;
-; Registers and calling conventions:
-; ----------------------------------
-;
-; Unless otherwise stated, all routines accept any value in, and may
-; trash, W and the flags.  All other registers and locations not
-; specifically mentioned here will be preserved by the
-; serial_... routines (and are therefore reserved for the rest of the
-; program).  In all cases, routines are called with CALL or RCALL or
-; the equivalent, and routines are allowed to have subroutines (ie, to
-; use the call/return address stack).
-
-; serial_... routines except serial_interrupt will never _directly_ call
-; any serialu_... routine; when we say `causes' this means that the
-; relevant serialu_... routine will be called at some later point from
-; serial_interrupt.  serialu_... routines are allowed to call appropriate
-; serial_... routines (except serial_interrupt) directly if the context
-; and Tx State allows.
-
-; All routines except serial_init and serial_write_please
-; must be called only:
-;   * During a low-priority interrupt;
-;   * From the main loop with low-priority interrupts disabled; or
-;   * From within an serialu_... routine (which are always called
-;     from within serial_interrupt).
-; This is to avoid having one serial_... routine running in an interrupt
-; which interrupted the middle of another serial_... routine.
-
-; Some time between calling serial_init and waiting for the first event,
-; the main program should of course enable interrupts.
-
-;============================================================
-; COMMON ROUTINES and RECEPTION
-
-;--------------------
- extern serial_init
-;
-; Initialises the serial port and library state appropriately.  Must
-; be called exactly once, which must be before any other
-; serial_... function.
-;
-;                              At call                 On return
-;   serial controller          any                     for use by seriallib
-;   PORTB                      any                     for use by seriallib
-;   serial interrupt config    any                     enabled, low priority
-;   Port B interrupt-on-change any                     enabled, low priority
-;   TRISB<5:7>                 any outputs configured  unchanged
-;   TRISB<4>                   any                     configured for input
-;   TRISB<0:2>                 any                     unchanged
-;   LATB                       any outputs configured  unchanged, use freely
-;   global interrupt enable    disabled                unchanged
-;   Tx State                   Not-in-use              Must-Notify
-;
-; Note that as soon as the interrupts are enabled, the serial port
-; will generate an interrupt, so that we go from Tx State Must-Notify
-; to Idle via call to serialu_writeable.  (See the Transmission
-; section below.)
-
-;--------------------
- extern serial_portb_read
-;                              At call                 On return
-;   W                          any                     value from PORTB
-;
-; Provided to allow the main program to read any bits in PORTB which
-; it is using as inputs.  See the notes above about PORTB.
-
-;--------------------
- extern serial_interrupt
-;
-; Must be called by the main program's low priority interrupt handler.
-; The main program's interrupt handler is responsible for saving W and
-; the flags register and other interrupt-related administrivia.  If
-; there is a serial interrupt, this routine will service it, taking any
-; necessary action including calling appropriate serialu_... routines,
-; and clear the interrupt flag[*].
-;
-;                              At call                 On return
-;   Tx State                   any except Not-in-use   may change
-;   serial interrupt state     any                     cleared[*]
-;
-; [*] The interrupt event on entry, if any, will be dealt with.  If
-; interrupt processing takes a long time, another interrupt will occur
-; and this may result in the serial interrupt flag being set on return
-; from serial_inerrupt.
-
-;--------------------
- extern serialu_receive
-;
-; Called to notify the main program that a byte has been recieved from
-; the host.  The byte value is supplied.  There is no way for the PIC
-; to signal flow control to the host, to stop the host from sending
-; data.  It is up to the main program to do _something_ with the
-; received data (or to panic or to discard it).
-;
-;              Beforehand      At call
-;   W                          data byte from host
-
-;======================================================================
-; TRANSMISSION
-;
-; States:
-;                      [Not-in-use]
-;                            |
-;                           |init
-;                            V
-;             ,------------->+<-------------.
-;             |              |              |
-;             |         [Must-Notify]       |
-;             |              |              |
-;             |   write_ready|              |
-;             |              |             |
-;             |              V                     |
-;             |            [Idle]           |
-;             |              |         `-----------'
-;             |    write_byte|    write_please
-;             |              |
-;             |              V
-;             |            [Busy]<----------.
-;             |              |  `-----------'
-;             `--------------'    write_please
-
-; The seriallib will handle the host's requests for flow control.
-
-;--------------------
- extern serialu_write_ready
-;
-; Called to notify the main program that the serial port is now ready
-; to transmit a byte.  The main program should call serial_write_byte,
-; or serial_write_please, either immediately or at some later point.
-;
-;              Beforehand      At call
-;   Tx State   Must-Notify     Idle
-
-;--------------------
- extern serial_write_byte
-;
-; Provides a byte to be written to the serial port.
-;
-;                              At call         On return
-;   Tx State                   Idle            Busy
-;   W                          byte for host   any
-
-;--------------------
- extern serial_write_please
-;
-; Asks to be re-notified if the serial port is ready for transmission.
-; This will regenerate the call to serialu_write_ready if applicable.
-;
-;                              At call         On return
-;   Tx State                   Idle            Must-Notify
-;   Tx State                   Busy            Busy
-;
-; serialu_write_ready will *not* be called directly from
-; serial_write_please, but only from serial_interrupt (as discussed
-; above).
-;
-; Exceptionally, serial_write_please is fully reentrant.  It need not
-; be called from interrupt context and need not be called with
-; interrupts disabled.  It is permissible for serial_write_please to
-; be interrupted by an invocation of serial_interrupt or vice versa.
-;
-; Use example: if the main program has a buffer of characters for
-; transmission, serialu_write_ready would call serial_write_byte if
-; the buffer had something in it.  If it didn't then it would simply
-; return.  When something is put in the buffer, the main program would
-; call serial_write_please unconditionally, which would ensure that
-; serialu_write_ready will be called soon.
-
-;======================================================================
index 220f16771195cdee355654861219bf8d12d07eaa..b63dd7f92212ba1b48b4d3621b125d228e296e6d 100644 (file)
 
  include common.inc
 
-garbage2 code 0x2000
- db 1
-garbage6 code 0x6000
- db 1
-
        udata_acs
 
 t      res     1
diff --git a/detpic/variables.asm b/detpic/variables.asm
deleted file mode 100644 (file)
index 03a4105..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-; reservations for variables
-
-; boilerplate:
-
-        include         /usr/share/gputils/header/p18f458.inc
-        radix           dec
-
-
-       end
index 7ad2d7d5ffcd30505c54648824b7295ee39bf427..67f7942969478b61689305aa88ab155753c264ff 100644 (file)
@@ -7,6 +7,8 @@ include ../cprogs.make
 
 TARGETS=       hostside hostside-old gui-plan-bot
 
+default:       all
+recurse:       all
 all:           $(TARGETS)
 
 hostside-old:  serialio.o nmra.o main.o encode.o utils.o
index 696a170ec721cffb017e9ce5f761334fac0be35c..02dacca1333791255465ac3ac8a82ac6fb623898 100644 (file)
@@ -9,8 +9,20 @@ PROGRAMS=      flasher copybits serialloop harness
 INCLUDES=      insn-aliases.inc  onecopybit.inc  test.inc
 
 include ../common.make
+
+PROGRAM_HEXES= $(addsuffix .hex, $(PROGRAMS)) \
+               $(addsuffix -withcfg.hex, $(PROGRAMS))
+
+all:           $(TARGETS) $(PROGRAM_HEXES)
+
 include ../pic.make
 
+%-withcfg.hex: %.o config.o $(LIBS) $(DEFLIBS)
+               $(LINK)
+
+%.hex:         %.o $(LIBS) $(DEFLIBS)
+               $(LINK)
+
 clean:         pic-clean
                rm -f $(INSN_TARGETS)
 
index 025b630221ae8bc75cc312c779cc2ea8c3ae6f40..777d438ea7984a3a4c49e02c7c87b01ae458bd4b 100644 (file)
@@ -22,6 +22,8 @@ LPAGES=        $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
 CPROGS=                subseg2display compose-segenco
 
 default:       $(CPROGS) for-test-ui
+for-pic:       ours-pindata.asm
+recurse:       $(CPROGS) for-pic
 all:           default lpages layers extras
 for-test-ui:   ours.graph.c ours.redactgraph ours.raw.neato.ps \
                ours.redacted.neato.ps ours.layout-data.o \
@@ -35,8 +37,10 @@ extras:              dualjn-a.ps parts.ps
 include ours.dgram.m
 include segencolayers.m
 
-NETPBM=                -lnetpbm
-# -lppm
+NETPBM =       -lnetpbm
+ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
+NETPBM +=      -lppm
+endif
 
 REDACT=                consistency movfeatsplitedges   \
                consistency movfeatrmstubs      \
index 478181c66277279efc195fd7cb62b5bcecfdde72..45009c60db3f10b36e7b0265d318cf551ee2660c 100644 (file)
--- a/pic.make
+++ b/pic.make
 #   FOO-entire0.hex    FOO.o           idlocs0.o       config.o
 #   perpicNUMBER.hex                   idlocsNUMBER.o  config.o
 
-PROGRAM_HEXES= $(addsuffix .hex, $(PROGRAMS)) \
-               $(addsuffix -withcfg.hex, $(PROGRAMS))
-
-all:           $(TARGETS) $(PROGRAM_HEXES)
 LINK=          gplink -m -o $@ $^
 ASSEMBLE=      gpasm -p 18f458
 
-%-withcfg.hex: %.o config.o $(LIBS) $(DEFLIBS)
-               $(LINK)
-
-%.hex:         %.o $(LIBS) $(DEFLIBS)
-               $(LINK)
-
 %.o:           %.asm $(INCLUDES)
                $(ASSEMBLE) -c $<
                mv $*.lst $*-asm.lst
@@ -35,4 +25,4 @@ ASSEMBLE=     gpasm -p 18f458
 
 pic-clean:
                -rm -f -- *~ *.new *.tmp
-               -rm -f *.hex *.cod *.lst *.o
+               -rm -f *.hex *.cod *.lst *.o *.map