ref: 8370fd16f8e62614b67941b32e2cd0e00fcc6e02
parent: 276fb4f109a09839c203cc3ce270639e0d605084
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Mar 13 05:56:07 EDT 2018
[ld] Add skeleton for ld
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
include rules.mk
-DIRS = inc cc1 cc2 driver lib as ar nm objdump
+DIRS = inc cc1 cc2 driver lib as ar nm objdump ld
all:
$(FORALL)
--- /dev/null
+++ b/ld/Makefile
@@ -1,0 +1,28 @@
+.POSIX:
+
+PROJECTDIR = ..
+LIBDIR = $(PROJECTDIR)/lib/scc
+include $(PROJECTDIR)/rules.mk
+include $(LIBDIR)/libdep.mk
+
+OBJ = main.o
+
+all: ld
+ mkdir -p $(PROJECTDIR)
+ cp ld $(PROJECTDIR)/rootdir/bin
+
+ld: $(OBJ)
+ $(CC) $(SCC_LDFLAGS) $(OBJ) -lscc -o $@
+
+$(LIBDIR)/libscc.a: $(LIB-OBJ)
+ +cd $(LIBDIR) && $(MAKE)
+
+dep:
+ $(PROJECTDIR)/mkdep.sh
+
+clean:
+ rm -f ld *.o
+
+distclean: clean
+
+#deps
--- /dev/null
+++ b/ld/main.c
@@ -1,0 +1,12 @@
+static char sccsid[] = "@(#) ./ld/main.c";
+
+#include <stdio.h>
+
+#include "../inc/arg.h"
+#include "../inc/scc.h"
+
+int
+main(int argc, char *argv[])
+{
+ return 0;
+}