LIBS = ../../Library/libs/syslib.lib
-FCC = ../../Library/tools/fcc
-
APPS = $(OBJS:.rel=)
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
+++ /dev/null
-syslib.lib
\ No newline at end of file
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);
exit(1);
}
fclose(bin);
+ printf("%s: %d bytes from %d\n", argv[argp], s__DATA - progload, progload);
exit(0);
}
{
pid_t pid, w;
int status;
-
+
if (verbose)
printf("\n\n");
argvec[argp] = NULL;
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);
}
}
}
- 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();
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));
# 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