commit a1ac9ad6601ed315c1dd8ecaa323296d17f39a14
parent 564b8fa720db69f222aa8eb2dec7e0b4c95696da
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 29 Sep 2017 16:16:36 +0100
[ar] Separate the not standard part to a different file
We already have a DRIVER variable that indicate the host
system where we want to run, so it is a good idea to reuse
the same variable here.
Diffstat:
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/ar/Makefile b/ar/Makefile
@@ -1,8 +1,16 @@
+.POSIX:
+
+include ../config.mk
+
+OBJ = ar.o $(DRIVER/stat.c
+MOREFLAGS=-I$(DRIVER)
all: ar
+ar.o: $(DRIVER)/stat.h
+
dep:
clean:
- rm -f ar
+ rm -f ar *.o $(DRIVER)/*.o
distclean: clean
diff --git a/ar/ar.c b/ar/ar.c
@@ -1,13 +1,11 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stat.h>
+
int
main(int argc, char *argv[])
{
diff --git a/ar/posix/stat.c b/ar/posix/stat.c
@@ -0,0 +1,3 @@
+static char sccsid[] = "@(#) ./ar/stat.c";
+
+#include "stat.h"
diff --git a/ar/posix/stat.h b/ar/posix/stat.h
@@ -0,0 +1,5 @@
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+