shithub: scc

Download patch

ref: c2ec983c04747f3174c2a46e474be1a4a4e0ff3b
parent: 5537a8378233d7ae3073fd31b68d47758eba7f64
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Sep 29 12:39:49 EDT 2017

[ar] Use common Makefile structure

--- a/ar/Makefile
+++ b/ar/Makefile
@@ -1,13 +1,21 @@
 .POSIX:
 
+LIBDIR    = ../lib/scc
 include ../config.mk
+include $(LIBDIR)/libdep.mk
 
-OBJ = ar.o $(DRIVER/stat.c
-MOREFLAGS=-I$(DRIVER)
+OBJ       = main.o $(DRIVER)/stat.c
+MOREFLAGS = -I$(DRIVER)
 
-all: ar
+all: ar-$(DRIVER)
 
-ar.o: $(DRIVER)/stat.h
+ar-$(DRIVER): $(OBJ) $(LIBDIR)/libscc.a
+	$(CC) $(SCC_LDFLAGS) $(OBJ) -lscc -o $@
+
+$(LIBDIR)/libscc.a: $(LIB-OBJ)
+	cd $(LIBDIR) && $(MAKE)
+
+main.o: $(DRIVER)/stat.h
 
 dep:
 clean: