From c1eee4db3188f61b52f5d9e91c3946486964d5f4 Mon Sep 17 00:00:00 2001
From: Aurelio Colosimo <aurelio@aureliocolosimo.it>
Date: Mon, 18 Feb 2013 23:49:43 +0100
Subject: [PATCH] Makefile: actually build ppsi

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---
 Makefile | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Makefile b/Makefile
index 3e6a801..2a0814e 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,25 @@ obj-$(CONFIG_PTP_NOPOSIX) += wrc_ptp.o \
 	$(PTP_NOPOSIX)/libposix/freestanding-startup.o \
 	$(PTP_NOPOSIX)/libposix/freestanding-wrapper.o
 
+cflags-$(CONFIG_PPSI) += \
+	-ffreestanding \
+	-Iinclude \
+	-I$(PPSI)/include \
+	-I$(PPSI)/arch-spec/include \
+	-I$(PPSI)/proto-ext-whiterabbit \
+	-Iboards/spec
+
+# FIXM: The following it temporary, untile we clean up
+cflags-$(CONFIG_PPSI) += \
+	-I$(PTP_NOPOSIX)/PTPWRd \
+	-I$(PTP_NOPOSIX)/wrsw_hal \
+	-include $(PTP_NOPOSIX)/PTPWRd/dep/trace.h \
+
+obj-$(CONFIG_PPSI) += wrc_ptp_ppsi.o \
+	monitor/monitor_ppsi.o \
+	$(PPSI)/ppsi.o \
+	$(PPSI)/arch-spec/libarch.a
+
 CFLAGS_PLATFORM  = -mmultiply-enabled -mbarrel-shift-enabled
 LDFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled \
 	-nostdlib -T $(LDS)
@@ -96,6 +115,10 @@ all: tools $(OUTPUT).ram $(OUTPUT).vhd
 .PRECIOUS: %.elf %.bin
 .PHONY: all tools clean gitmodules $(PPSI)/ppsi.o
 
+$(PPSI)/ppsi.o:
+	$(MAKE) -C $(PPSI) ARCH=spec PROTO_EXT=whiterabbit HAS_FULL_DIAG=y \
+		CROSS_COMPILE=$(CROSS_COMPILE)
+
 $(OUTPUT).elf: $(LDS) $(AUTOCONF) gitmodules $(OUTPUT).o
 	$(CC) $(CFLAGS) -DGIT_REVISION=\"$(REVISION)\" -c revision.c
 	${CC} -o $@ revision.o $(OUTPUT).o $(LDFLAGS)
-- 
GitLab