Browse Source

samples: move mic/mpssd example code from Documentation

Move mic/mpssd examples to samples and remove it from Documentation
Makefile. Create a new Makefile to build mic/mpssd. It can be built
from top level directory or from mic/mpssd directory:

Run make -C samples/mic/mpssd or cd samples/mic/mpssd; make

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Shuah Khan 9 years ago
parent
commit
6bee835dd5

+ 1 - 1
Documentation/Makefile

@@ -1,2 +1,2 @@
 subdir-y := accounting auxdisplay blackfin \
-	laptops mic misc-devices pcmcia timers watchdog
+	laptops misc-devices pcmcia timers watchdog

+ 0 - 1
Documentation/mic/Makefile

@@ -1 +0,0 @@
-subdir-y := mpssd

+ 0 - 21
Documentation/mic/mpssd/Makefile

@@ -1,21 +0,0 @@
-ifndef CROSS_COMPILE
-# List of programs to build
-hostprogs-$(CONFIG_X86_64) := mpssd
-
-mpssd-objs := mpssd.o sysfs.o
-
-# Tell kbuild to always build the programs
-always := $(hostprogs-y)
-
-HOSTCFLAGS += -I$(objtree)/usr/include -I$(srctree)/tools/include
-
-ifdef DEBUG
-HOSTCFLAGS += -DDEBUG=$(DEBUG)
-endif
-
-HOSTLOADLIBES_mpssd := -lpthread
-
-install:
-	install mpssd /usr/sbin/mpssd
-	install micctrl /usr/sbin/micctrl
-endif

+ 0 - 0
Documentation/mic/mpssd/.gitignore → samples/mic/mpssd/.gitignore


+ 27 - 0
samples/mic/mpssd/Makefile

@@ -0,0 +1,27 @@
+ifndef CROSS_COMPILE
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+
+ifeq ($(ARCH),x86)
+
+PROGS := mpssd
+CC = $(CROSS_COMPILE)gcc
+CFLAGS := -I../../../usr/include -I../../../tools/include
+
+ifdef DEBUG
+CFLAGS += -DDEBUG=$(DEBUG)
+endif
+
+all: $(PROGS)
+mpssd: mpssd.c sysfs.c
+	$(CC) $(CFLAGS) mpssd.c sysfs.c -o mpssd -lpthread
+
+install:
+	install mpssd /usr/sbin/mpssd
+	install micctrl /usr/sbin/micctrl
+
+clean:
+	rm -fr $(PROGS)
+
+endif
+endif

+ 0 - 0
Documentation/mic/mpssd/micctrl → samples/mic/mpssd/micctrl


+ 0 - 0
Documentation/mic/mpssd/mpss → samples/mic/mpssd/mpss


+ 0 - 0
Documentation/mic/mpssd/mpssd.c → samples/mic/mpssd/mpssd.c


+ 0 - 0
Documentation/mic/mpssd/mpssd.h → samples/mic/mpssd/mpssd.h


+ 0 - 0
Documentation/mic/mpssd/sysfs.c → samples/mic/mpssd/sysfs.c