Oops: revert Will's bits I didn't mean to merge
authorAlan Cox <alan@linux.intel.com>
Sat, 27 Dec 2014 00:45:09 +0000 (00:45 +0000)
committerAlan Cox <alan@linux.intel.com>
Sat, 27 Dec 2014 00:45:09 +0000 (00:45 +0000)
Applications/util/Makefile
Library/libs/c.lib [deleted symlink]
Library/tools/binman.c
Library/tools/fcc.c
Library/tools/libclean

index 3615c33..f96f5a9 100644 (file)
@@ -76,8 +76,6 @@ OBJS = $(SRCS:.c=.rel)
 
 LIBS = ../../Library/libs/syslib.lib
 
-FCC = ../../Library/tools/fcc
-
 APPS = $(OBJS:.rel=)
 
 all: $(APPS)
@@ -85,10 +83,13 @@ all: $(APPS)
 $(OBJS): $(SRCS)
 
 .c.rel:
-       $(FCC) -c $<
+       $(CC) $(CC_OPT) $(@:.rel=.c)
 
 %: %.rel
-       $(FCC) $< -o $@
+       $(LINKER) $(LINKER_OPT) ../../Library/libs/crt0.rel $< $(LIBS) -o $@.ihx
+       makebin -s 65536 $@.ihx $@.tmp
+       $(BINMAN) $(PROGLOAD) $@.tmp $@.map $@
+       chmod +x $@
 
 clean:
        rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp
diff --git a/Library/libs/c.lib b/Library/libs/c.lib
deleted file mode 120000 (symlink)
index b602f7e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-syslib.lib
\ No newline at end of file
index c2cb69f..adf2061 100644 (file)
@@ -79,9 +79,9 @@ int main(int argc, char *argv[])
   ProcessMap(map);
   fclose(map);
   
-  bin = fopen(argv[argp++], "w");
+  bin = fopen(argv[argp], "w");
   if (bin == NULL) {
-    perror(argv[argp - 1]);
+    perror(argv[argp]);
     exit(1);
   }
   memcpy(buf + s__INITIALIZED, buf + s__INITIALIZER, l__INITIALIZER);
@@ -92,5 +92,6 @@ int main(int argc, char *argv[])
    exit(1);
   }
   fclose(bin);
+  printf("%s: %d bytes from %d\n", argv[argp], s__DATA - progload, progload);
   exit(0);
 }
index 884a513..966d535 100644 (file)
@@ -256,7 +256,7 @@ static int do_command(void)
 {
   pid_t pid, w;
   int status;
-
+  
   if (verbose)
     printf("\n\n");
   argvec[argp] = NULL;
@@ -334,7 +334,7 @@ static void build_command(void)
     autotarget();
   add_option("-o", target);
   if (mode == MODE_LINK) {
-    add_argument("/home/btg/projects/fuzix/Library/libs/crt0.rel");
+    add_argument("/opt/fcc/lib/crt0.rel");
   }
   if (srchead)
     add_argument_list(srchead);
@@ -430,8 +430,8 @@ int main(int argc, const char *argv[]) {
       }
     }
   }
-  add_include_path("/home/btg/projects/fuzix/Library/include/");
-  add_library_path("/home/btg/projects/fuzix/Library/libs/");
+  add_include_path("/opt/fcc/include/");
+  add_library_path("/opt/fcc/lib/");
   add_library("c");
 
   build_command();
@@ -449,7 +449,7 @@ int main(int argc, const char *argv[]) {
   if (ret)
     exit(ret);
   argp = 0;
-  add_argument("/home/btg/projects/fuzix/Library/tools/binman");
+  add_argument("/opt/fcc/bin/binman");
   add_argument(t);
   add_argument(rebuildname("", target, "map"));
   add_argument(chopname(target));
index 632fbff..12df92c 100755 (executable)
@@ -3,22 +3,8 @@
 #      Clean the supplied SDCC library of stuff we don't want. This
 #      IMHO beats forking the library or building a private copy.
 #
-
-# Look for the sdcc library in one of the common locations
-for f in /opt/sdcc/share/sdcc/lib/z80/z80.lib \
-         /usr/local/share/sdcc/lib/z80/z80.lib \
-         /usr/share/sdcc/lib/z80/z80.lib; do
-    if [ -e $f ]; then
-        cp $f tmp.lib
-        break
-    fi;
-done
-
-if [ ! -e tmp.lib ]; then
-    echo "Cannot find sdcc z80.lib"
-    exit 1
-fi
-
+#
+cp /opt/sdcc/share/sdcc/lib/z80/z80.lib tmp.lib
 #
 #      Scrub the functions we don't want to inherit
 #      Need to review setjmp and maybe a couple of others