Various tweaks to utilities to build cleanly on my system
authorWill Sowerbutts <will@sowerbutts.com>
Sat, 27 Dec 2014 00:36:08 +0000 (00:36 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sat, 27 Dec 2014 00:36:08 +0000 (00:36 +0000)
Applications/util/Makefile
Library/libs/c.lib [new symlink]
Library/libs/fuzix/Makefile
Library/tools/fcc.c
Library/tools/libclean

index f96f5a9..3615c33 100644 (file)
@@ -76,6 +76,8 @@ OBJS = $(SRCS:.c=.rel)
 
 LIBS = ../../Library/libs/syslib.lib
 
+FCC = ../../Library/tools/fcc
+
 APPS = $(OBJS:.rel=)
 
 all: $(APPS)
@@ -83,13 +85,10 @@ all: $(APPS)
 $(OBJS): $(SRCS)
 
 .c.rel:
-       $(CC) $(CC_OPT) $(@:.rel=.c)
+       $(FCC) -c $<
 
 %: %.rel
-       $(LINKER) $(LINKER_OPT) ../../Library/libs/crt0.rel $< $(LIBS) -o $@.ihx
-       makebin -s 65536 $@.ihx $@.tmp
-       $(BINMAN) $(PROGLOAD) $@.tmp $@.map $@
-       chmod +x $@
+       $(FCC) $< -o $@
 
 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
new file mode 120000 (symlink)
index 0000000..b602f7e
--- /dev/null
@@ -0,0 +1 @@
+syslib.lib
\ No newline at end of file
index 8248571..f38e10a 100644 (file)
@@ -64,6 +64,7 @@ ASRCS += syscall_waitpid.s
 ASRCS += syscall__profil.s
 ASRCS += syscall_uadmin.s
 ASRCS += syscall_nice.s
+ASRCS += syscall__sigdisp.s
 
 
 ASRCALL = $(ASRCS) $(ASYS)
index 966d535..884a513 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("/opt/fcc/lib/crt0.rel");
+    add_argument("/home/btg/projects/fuzix/Library/libs/crt0.rel");
   }
   if (srchead)
     add_argument_list(srchead);
@@ -430,8 +430,8 @@ int main(int argc, const char *argv[]) {
       }
     }
   }
-  add_include_path("/opt/fcc/include/");
-  add_library_path("/opt/fcc/lib/");
+  add_include_path("/home/btg/projects/fuzix/Library/include/");
+  add_library_path("/home/btg/projects/fuzix/Library/libs/");
   add_library("c");
 
   build_command();
@@ -449,7 +449,7 @@ int main(int argc, const char *argv[]) {
   if (ret)
     exit(ret);
   argp = 0;
-  add_argument("/opt/fcc/bin/binman");
+  add_argument("/home/btg/projects/fuzix/Library/tools/binman");
   add_argument(t);
   add_argument(rebuildname("", target, "map"));
   add_argument(chopname(target));
index 12df92c..632fbff 100755 (executable)
@@ -3,8 +3,22 @@
 #      Clean the supplied SDCC library of stuff we don't want. This
 #      IMHO beats forking the library or building a private copy.
 #
-#
-cp /opt/sdcc/share/sdcc/lib/z80/z80.lib tmp.lib
+
+# 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
+
 #
 #      Scrub the functions we don't want to inherit
 #      Need to review setjmp and maybe a couple of others