summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2016-05-28 18:41:04 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2016-06-10 18:06:59 -0400
commit40a360c2a4feef97a8f7041e655b2a42e51e0224 (patch)
tree75dfea3064d7c3243788c72cb9f30e2ce6241dea
parenta73122191a7aba80f97332687a2e03cfb0336981 (diff)
downloadtalos-skeleton-40a360c2a4feef97a8f7041e655b2a42e51e0224.tar.gz
talos-skeleton-40a360c2a4feef97a8f7041e655b2a42e51e0224.zip
Reorganize directory structure
Moving to directory per-application layout. This facilitates building single applications which is useful in the Yocto build environment since different applications satisfy different OpenBMC build requirements. A number of issues are also addressed: - All applications were pulling in libsystemd and the gdbus libs irrespective of whether or not they were needed. - gpio.o duplicated in every application - moved to libopenbmc_intf - Added install target Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r--.gitignore9
-rw-r--r--[-rwxr-xr-x]Makefile128
-rw-r--r--Makefile.python1
-rwxr-xr-xbin/hconsole13
-rw-r--r--bmcctl-barreleye/Makefile3
-rw-r--r--bmcctl-barreleye/control_bmc_barreleye.c (renamed from objects/control_bmc_barreleye.c)0
-rw-r--r--bmcctl/Makefile3
-rw-r--r--bmcctl/control_bmc_obj.c (renamed from objects/control_bmc_obj.c)0
-rw-r--r--boardvpd/Makefile3
-rw-r--r--boardvpd/board_vpd_obj.c (renamed from objects/board_vpd_obj.c)0
-rw-r--r--[-rwxr-xr-x]configs/Barreleye.py (renamed from bin/Barreleye.py)0
-rw-r--r--[-rwxr-xr-x]configs/Firestone.py (renamed from bin/Firestone.py)0
-rw-r--r--[-rwxr-xr-x]configs/Garrison.py (renamed from bin/Garrison.py)0
l---------configs/Makefile1
-rw-r--r--[-rwxr-xr-x]configs/Palmetto.py (renamed from bin/Palmetto.py)0
-rw-r--r--configs/setup.py6
-rw-r--r--fanctl/Makefile3
-rw-r--r--fanctl/fan_generic_obj.c (renamed from objects/fan_generic_obj.c)0
-rw-r--r--flashbios/Makefile3
-rw-r--r--flashbios/flash_bios_obj.c (renamed from objects/flash_bios_obj.c)0
-rw-r--r--gdbus.mk11
-rwxr-xr-xgdbus/codegen (renamed from codegen)0
-rw-r--r--gdbus/interfaces/openbmc_intf.c (renamed from interfaces/openbmc_intf.c)0
-rw-r--r--gdbus/interfaces/openbmc_intf.h (renamed from interfaces/openbmc_intf.h)0
-rw-r--r--gdbus/xml/openbmc_intf.xml (renamed from xml/openbmc_intf.xml)0
-rw-r--r--hacks/Makefile7
-rw-r--r--[-rwxr-xr-x]hacks/startup_hacks.sh (renamed from bin/startup_hacks.sh)0
-rw-r--r--hostwatchdog/Makefile3
-rw-r--r--hostwatchdog/host_watchdog_obj.c (renamed from objects/host_watchdog_obj.c)0
-rw-r--r--hwmon-barreleye/Makefile3
-rw-r--r--hwmon-barreleye/hwmons_barreleye.c (renamed from objects/hwmons_barreleye.c)0
-rw-r--r--hwmon/Makefile3
-rw-r--r--hwmon/hwmons_palmetto.c (renamed from objects/hwmons_palmetto.c)0
-rw-r--r--includes/sensor_threshold.c63
-rw-r--r--includes/sensor_threshold.h15
-rw-r--r--ledctl/Makefile3
-rw-r--r--ledctl/led_controller.c (renamed from objects/led_controller.c)0
-rw-r--r--libopenbmc_intf/Makefile20
-rw-r--r--[-rwxr-xr-x]libopenbmc_intf/gpio.c (renamed from includes/gpio.c)0
-rw-r--r--libopenbmc_intf/gpio.h (renamed from includes/gpio.h)0
-rw-r--r--libopenbmc_intf/openbmc.h (renamed from includes/openbmc.h)0
l---------libopenbmc_intf/openbmc_intf.c1
l---------libopenbmc_intf/openbmc_intf.h1
-rw-r--r--objects/pflash/progress.obin3608 -> 0 bytes
-rw-r--r--op-flasher/Makefile14
-rw-r--r--op-flasher/flasher_obj.c (renamed from objects/flasher_obj.c)2
-rw-r--r--op-flasher/pflash/Makefile (renamed from objects/pflash/Makefile)0
-rw-r--r--op-flasher/pflash/TODO (renamed from objects/pflash/TODO)0
-rw-r--r--op-flasher/pflash/arm_io.c (renamed from objects/pflash/arm_io.c)0
-rw-r--r--op-flasher/pflash/ast-sf-ctrl.c (renamed from objects/pflash/ast-sf-ctrl.c)0
-rw-r--r--op-flasher/pflash/ast.h (renamed from objects/pflash/ast.h)0
-rw-r--r--op-flasher/pflash/ccan/Makefile.inc (renamed from objects/pflash/ccan/Makefile.inc)0
-rw-r--r--op-flasher/pflash/ccan/array_size/LICENSE (renamed from objects/pflash/ccan/array_size/LICENSE)0
-rw-r--r--op-flasher/pflash/ccan/array_size/_info (renamed from objects/pflash/ccan/array_size/_info)0
-rw-r--r--op-flasher/pflash/ccan/array_size/array_size.h (renamed from objects/pflash/ccan/array_size/array_size.h)0
-rw-r--r--op-flasher/pflash/ccan/array_size/test/compile_fail-function-param.c (renamed from objects/pflash/ccan/array_size/test/compile_fail-function-param.c)0
-rw-r--r--op-flasher/pflash/ccan/array_size/test/compile_fail.c (renamed from objects/pflash/ccan/array_size/test/compile_fail.c)0
-rw-r--r--op-flasher/pflash/ccan/array_size/test/run.c (renamed from objects/pflash/ccan/array_size/test/run.c)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/LICENSE (renamed from objects/pflash/ccan/build_assert/LICENSE)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/_info (renamed from objects/pflash/ccan/build_assert/_info)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/build_assert.h (renamed from objects/pflash/ccan/build_assert/build_assert.h)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/test/compile_fail-expr.c (renamed from objects/pflash/ccan/build_assert/test/compile_fail-expr.c)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/test/compile_fail.c (renamed from objects/pflash/ccan/build_assert/test/compile_fail.c)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/test/compile_ok.c (renamed from objects/pflash/ccan/build_assert/test/compile_ok.c)0
-rw-r--r--op-flasher/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c (renamed from objects/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c)0
-rw-r--r--op-flasher/pflash/ccan/built-in.o (renamed from objects/pflash/ccan/built-in.o)bin14873 -> 14873 bytes
-rw-r--r--op-flasher/pflash/ccan/check_type/LICENSE (renamed from objects/pflash/ccan/check_type/LICENSE)0
-rw-r--r--op-flasher/pflash/ccan/check_type/_info (renamed from objects/pflash/ccan/check_type/_info)0
-rw-r--r--op-flasher/pflash/ccan/check_type/check_type.h (renamed from objects/pflash/ccan/check_type/check_type.h)0
-rw-r--r--op-flasher/pflash/ccan/check_type/test/compile_fail-check_type.c (renamed from objects/pflash/ccan/check_type/test/compile_fail-check_type.c)0
-rw-r--r--op-flasher/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c (renamed from objects/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c)0
-rw-r--r--op-flasher/pflash/ccan/check_type/test/compile_fail-check_types_match.c (renamed from objects/pflash/ccan/check_type/test/compile_fail-check_types_match.c)0
-rw-r--r--op-flasher/pflash/ccan/check_type/test/run.c (renamed from objects/pflash/ccan/check_type/test/run.c)0
-rw-r--r--op-flasher/pflash/ccan/container_of/LICENSE (renamed from objects/pflash/ccan/container_of/LICENSE)0
-rw-r--r--op-flasher/pflash/ccan/container_of/_info (renamed from objects/pflash/ccan/container_of/_info)0
-rw-r--r--op-flasher/pflash/ccan/container_of/container_of.h (renamed from objects/pflash/ccan/container_of/container_of.h)0
-rw-r--r--op-flasher/pflash/ccan/container_of/test/compile_fail-bad-type.c (renamed from objects/pflash/ccan/container_of/test/compile_fail-bad-type.c)0
-rw-r--r--op-flasher/pflash/ccan/container_of/test/compile_fail-types.c (renamed from objects/pflash/ccan/container_of/test/compile_fail-types.c)0
-rw-r--r--op-flasher/pflash/ccan/container_of/test/compile_fail-var-types.c (renamed from objects/pflash/ccan/container_of/test/compile_fail-var-types.c)0
-rw-r--r--op-flasher/pflash/ccan/container_of/test/run.c (renamed from objects/pflash/ccan/container_of/test/run.c)0
-rw-r--r--op-flasher/pflash/ccan/endian/LICENSE (renamed from objects/pflash/ccan/endian/LICENSE)0
-rw-r--r--op-flasher/pflash/ccan/endian/_info (renamed from objects/pflash/ccan/endian/_info)0
-rw-r--r--op-flasher/pflash/ccan/endian/endian.h (renamed from objects/pflash/ccan/endian/endian.h)0
-rw-r--r--op-flasher/pflash/ccan/endian/test/compile_ok-constant.c (renamed from objects/pflash/ccan/endian/test/compile_ok-constant.c)0
-rw-r--r--op-flasher/pflash/ccan/endian/test/run.c (renamed from objects/pflash/ccan/endian/test/run.c)0
-rw-r--r--op-flasher/pflash/config.h (renamed from objects/pflash/config.h)0
-rw-r--r--op-flasher/pflash/get_arch.sh (renamed from objects/pflash/get_arch.sh)0
-rw-r--r--op-flasher/pflash/io.h (renamed from objects/pflash/io.h)0
-rw-r--r--op-flasher/pflash/libflash/ffs.h (renamed from objects/pflash/libflash/ffs.h)0
-rw-r--r--op-flasher/pflash/libflash/libffs.c (renamed from objects/pflash/libflash/libffs.c)0
-rw-r--r--op-flasher/pflash/libflash/libffs.h (renamed from objects/pflash/libflash/libffs.h)0
-rw-r--r--op-flasher/pflash/libflash/libflash-priv.h (renamed from objects/pflash/libflash/libflash-priv.h)0
-rw-r--r--op-flasher/pflash/libflash/libflash.c (renamed from objects/pflash/libflash/libflash.c)0
-rw-r--r--op-flasher/pflash/libflash/libflash.h (renamed from objects/pflash/libflash/libflash.h)0
-rw-r--r--op-flasher/pflash/libflash/test/Makefile (renamed from objects/pflash/libflash/test/Makefile)0
-rw-r--r--op-flasher/pflash/libflash/test/test-flash.c (renamed from objects/pflash/libflash/test/test-flash.c)0
-rw-r--r--op-flasher/pflash/pflash.c (renamed from objects/pflash/pflash.c)0
-rw-r--r--op-flasher/pflash/powerpc_io.c (renamed from objects/pflash/powerpc_io.c)0
-rw-r--r--op-flasher/pflash/progress.c (renamed from objects/pflash/progress.c)0
-rw-r--r--op-flasher/pflash/progress.h (renamed from objects/pflash/progress.h)0
-rw-r--r--op-flasher/pflash/sfc-ctrl.c (renamed from objects/pflash/sfc-ctrl.c)0
-rw-r--r--op-flasher/pflash/sfc-ctrl.h (renamed from objects/pflash/sfc-ctrl.h)0
-rw-r--r--op-hostctl/Makefile3
-rw-r--r--[-rwxr-xr-x]op-hostctl/control_host_obj.c (renamed from objects/control_host_obj.c)0
-rw-r--r--op-pwrctl/Makefile3
-rw-r--r--op-pwrctl/power_control_obj.c (renamed from objects/power_control_obj.c)0
-rw-r--r--pciedetect/Makefile3
-rw-r--r--pciedetect/pcie_slot_present_obj.c (renamed from objects/pcie_slot_present_obj.c)0
-rw-r--r--pwrbutton/Makefile3
-rw-r--r--pwrbutton/button_power_obj.c (renamed from objects/button_power_obj.c)0
-rw-r--r--py.mk9
l---------pychassisctl/Makefile1
-rw-r--r--[-rwxr-xr-x]pychassisctl/chassis_control.py (renamed from bin/chassis_control.py)0
l---------pychassisctl/setup.cfg1
-rw-r--r--pychassisctl/setup.py6
l---------pydownloadmgr/Makefile1
-rw-r--r--[-rwxr-xr-x]pydownloadmgr/download_manager.py (renamed from bin/download_manager.py)0
l---------pydownloadmgr/setup.cfg1
-rw-r--r--pydownloadmgr/setup.py6
l---------pyfanctl/Makefile1
-rw-r--r--[-rwxr-xr-x]pyfanctl/fan_control.py (renamed from bin/fan_control.py)0
l---------pyfanctl/setup.cfg1
-rw-r--r--pyfanctl/setup.py6
l---------pyflashbmc/Makefile1
-rw-r--r--[-rwxr-xr-x]pyflashbmc/bmc_update.py (renamed from bin/bmc_update.py)0
l---------pyflashbmc/setup.cfg1
-rw-r--r--pyflashbmc/setup.py6
l---------pyhwmon/Makefile1
-rw-r--r--[-rwxr-xr-x]pyhwmon/hwmon.py (renamed from bin/hwmon.py)0
l---------pyhwmon/setup.cfg1
-rw-r--r--pyhwmon/setup.py6
l---------pyinventorymgr/Makefile1
-rw-r--r--[-rwxr-xr-x]pyinventorymgr/inventory_items.py (renamed from bin/inventory_items.py)0
l---------pyinventorymgr/setup.cfg1
-rw-r--r--pyinventorymgr/setup.py6
l---------pyipmitest/Makefile1
-rw-r--r--[-rwxr-xr-x]pyipmitest/ipmi_debug.py (renamed from bin/ipmi_debug.py)0
l---------pyipmitest/setup.cfg1
-rw-r--r--pyipmitest/setup.py6
l---------pysensormgr/Makefile1
-rw-r--r--[-rwxr-xr-x]pysensormgr/sensor_manager2.py (renamed from bin/sensor_manager2.py)0
l---------pysensormgr/setup.cfg1
-rw-r--r--pysensormgr/setup.py6
l---------pystatemgr/Makefile1
-rw-r--r--[-rwxr-xr-x]pystatemgr/discover_system_state.py (renamed from bin/discover_system_state.py)0
-rw-r--r--pystatemgr/goto_system_state.py (renamed from bin/goto_system_state.py)0
l---------pystatemgr/setup.cfg1
-rw-r--r--pystatemgr/setup.py6
l---------pysystemmgr/Makefile1
l---------pysystemmgr/setup.cfg1
-rw-r--r--pysystemmgr/setup.py6
-rw-r--r--[-rwxr-xr-x]pysystemmgr/system_manager.py (renamed from bin/system_manager.py)0
l---------pytools/Makefile1
-rw-r--r--[-rwxr-xr-x]pytools/gpioutil (renamed from bin/gpioutil)0
-rw-r--r--[-rwxr-xr-x]pytools/obmcutil (renamed from bin/obmcutil)0
l---------pytools/setup.cfg1
-rw-r--r--pytools/setup.py6
-rw-r--r--rstbutton/Makefile3
-rw-r--r--rstbutton/button_reset_obj.c (renamed from objects/button_reset_obj.c)0
-rw-r--r--rules.mk31
-rw-r--r--sdbus.mk1
-rw-r--r--setup.cfg2
162 files changed, 292 insertions, 173 deletions
diff --git a/.gitignore b/.gitignore
index 28e70be..a76f2a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
-lib/*
-obj/*
-bin/*.exe
-bin/pflash
+*.exe
+*.o
+*.so
+*.so.*
*.swp
*.swo
+*/build
diff --git a/Makefile b/Makefile
index 7129082..67d9102 100755..100644
--- a/Makefile
+++ b/Makefile
@@ -1,77 +1,51 @@
-#CC=gcc
-OBJS = objects/pflash/progress.o objects/pflash/ast-sf-ctrl.o
-OBJS += objects/pflash/libflash/libflash.o objects/pflash/libflash/libffs.o
-OBJS += objects/pflash/arm_io.o
-OBJS2 = progress.o ast-sf-ctrl.o libflash.o libffs.o arm_io.o
-OBJS3 = obj/progress.o obj/ast-sf-ctrl.o obj/libflash.o obj/libffs.o obj/arm_io.o
-INCLUDES=$(shell pkg-config --cflags gio-unix-2.0 glib-2.0) -Iincludes -Iobjects/pflash -I.
-LIBS=$(shell pkg-config --libs gio-unix-2.0 glib-2.0) -Llib -lopenbmc_intf
-INCLUDES += $(shell pkg-config --cflags --libs libsystemd) -I. -O2
-LIB_FLAG += $(shell pkg-config --libs libsystemd)
-
-%.o: interfaces/%.c
- $(CC) -c -fPIC -o obj/$@ $< $(CFLAGS) $(INCLUDES)
-
-%.o: objects/%.c
- $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
-
-%.o: includes/%.c
- $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
-
-%.o: objects/pflash/%.c
- $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
-
-%.o: objects/pflash/libflash/%.c
- $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
-
-all: setup libopenbmc_intf power_control led_controller button_power button_reset control_host host_watchdog board_vpd pcie_slot_present flash_bios flasher pflash hwmons_barreleye control_bmc
-
-setup:
- mkdir -p obj lib
-
-clean:
- rm -rf obj lib bin/*.exe
-
-libopenbmc_intf: openbmc_intf.o
- $(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(LDFLAGS)
-
-power_control: power_control_obj.o gpio.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o $(LDFLAGS) $(LIBS)
-
-led_controller: led_controller.o
- $(CC) -o bin/$@.exe obj/led_controller.o $(LDFLAGS) $(LIB_FLAG)
-
-button_power: button_power_obj.o gpio.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
-
-button_reset: button_reset_obj.o gpio.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/button_reset_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
-
-
-control_host: control_host_obj.o gpio.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o $(LDFLAGS) $(LIBS)
-
-flash_bios: flash_bios_obj.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/flash_bios_obj.o $(LDFLAGS) $(LIBS)
-
-host_watchdog: host_watchdog_obj.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/host_watchdog_obj.o $(LDFLAGS) $(LIBS)
-
-board_vpd: board_vpd_obj.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS)
-
-pcie_slot_present: pcie_slot_present_obj.o gpio.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
-
-flasher: $(OBJS2) flasher_obj.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS)
-
-pflash: $(OBJS2) pflash.o
- $(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS)
-
-hwmons_barreleye: hwmons_barreleye.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/hwmons_barreleye.o $(LDFLAGS) $(LIBS)
-
-control_bmc: control_bmc_obj.o libopenbmc_intf
- $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS)
-
+GDBUS_APPS = bmcctl \
+ bmcctl-barreleye \
+ boardvpd \
+ fanctl \
+ flashbios \
+ hostwatchdog \
+ hwmon \
+ hwmon-barreleye \
+ op-flasher \
+ op-hostctl \
+ op-pwrctl \
+ pciedetect \
+ pwrbutton \
+ rstbutton
+
+SUBDIRS = $(GDBUS_APPS) \
+ configs \
+ hacks \
+ ledctl \
+ libopenbmc_intf \
+ pychassisctl \
+ pydownloadmgr \
+ pyfanctl \
+ pyflashbmc \
+ pyhwmon \
+ pyinventorymgr \
+ pyipmitest \
+ pysensormgr \
+ pystatemgr \
+ pysystemmgr \
+ pytools
+
+REVERSE_SUBDIRS = $(shell echo $(SUBDIRS) | tr ' ' '\n' | tac |tr '\n' ' ')
+
+.PHONY: subdirs $(SUBDIRS)
+
+subdirs: $(SUBDIRS)
+
+$(SUBDIRS):
+ $(MAKE) -C $@
+
+$(GDBUS_APPS): libopenbmc_intf
+
+install: subdirs
+ @for d in $(SUBDIRS); do \
+ $(MAKE) -C $$d $@ DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) || exit 1; \
+ done
+clean:
+ @for d in $(REVERSE_SUBDIRS); do \
+ $(MAKE) -C $$d $@ || exit 1; \
+ done
diff --git a/Makefile.python b/Makefile.python
new file mode 100644
index 0000000..e501457
--- /dev/null
+++ b/Makefile.python
@@ -0,0 +1 @@
+include ../py.mk
diff --git a/bin/hconsole b/bin/hconsole
deleted file mode 100755
index 0d2777c..0000000
--- a/bin/hconsole
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/sh
-
-echo "Ctrl-a k to exit console"
-echo "A session log is created in current directory"
-if screen -list | grep "hostconsole" | grep -q -i "Detached"; then
- echo "You have an existing detached console session to host, you will be reconnected to that session"
-fi
-if screen -list | grep "hostconsole" | grep -q -i "Attached"; then
- echo "You have an existing attached console session to host, you will be detached from that session and reconnected here instead"
-fi
-echo "[Enter] to continue"
-read a
-screen -dR hostconsole -U /dev/ttyS5
diff --git a/bmcctl-barreleye/Makefile b/bmcctl-barreleye/Makefile
new file mode 100644
index 0000000..d98fdeb
--- /dev/null
+++ b/bmcctl-barreleye/Makefile
@@ -0,0 +1,3 @@
+BINS=control_bmc_barreleye
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/control_bmc_barreleye.c b/bmcctl-barreleye/control_bmc_barreleye.c
index f09e379..f09e379 100644
--- a/objects/control_bmc_barreleye.c
+++ b/bmcctl-barreleye/control_bmc_barreleye.c
diff --git a/bmcctl/Makefile b/bmcctl/Makefile
new file mode 100644
index 0000000..5d46ab0
--- /dev/null
+++ b/bmcctl/Makefile
@@ -0,0 +1,3 @@
+BINS=control_bmc
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/control_bmc_obj.c b/bmcctl/control_bmc_obj.c
index f3571cd..f3571cd 100644
--- a/objects/control_bmc_obj.c
+++ b/bmcctl/control_bmc_obj.c
diff --git a/boardvpd/Makefile b/boardvpd/Makefile
new file mode 100644
index 0000000..e19c0db
--- /dev/null
+++ b/boardvpd/Makefile
@@ -0,0 +1,3 @@
+BINS=board_vpd
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/board_vpd_obj.c b/boardvpd/board_vpd_obj.c
index b6c2119..b6c2119 100644
--- a/objects/board_vpd_obj.c
+++ b/boardvpd/board_vpd_obj.c
diff --git a/bin/Barreleye.py b/configs/Barreleye.py
index c23f657..c23f657 100755..100644
--- a/bin/Barreleye.py
+++ b/configs/Barreleye.py
diff --git a/bin/Firestone.py b/configs/Firestone.py
index 4767178..4767178 100755..100644
--- a/bin/Firestone.py
+++ b/configs/Firestone.py
diff --git a/bin/Garrison.py b/configs/Garrison.py
index e8f0927..e8f0927 100755..100644
--- a/bin/Garrison.py
+++ b/configs/Garrison.py
diff --git a/configs/Makefile b/configs/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/configs/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/Palmetto.py b/configs/Palmetto.py
index bb4d6f2..bb4d6f2 100755..100644
--- a/bin/Palmetto.py
+++ b/configs/Palmetto.py
diff --git a/configs/setup.py b/configs/setup.py
new file mode 100644
index 0000000..0132f01
--- /dev/null
+++ b/configs/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='openbmc_configs',
+ version='1.0',
+ py_modules=['Palmetto', 'Garrison', 'Barreleye', 'Firestone', 'Witherspoon'],
+ )
diff --git a/fanctl/Makefile b/fanctl/Makefile
new file mode 100644
index 0000000..4f86828
--- /dev/null
+++ b/fanctl/Makefile
@@ -0,0 +1,3 @@
+BINS=fan_generic
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/fan_generic_obj.c b/fanctl/fan_generic_obj.c
index 61083ae..61083ae 100644
--- a/objects/fan_generic_obj.c
+++ b/fanctl/fan_generic_obj.c
diff --git a/flashbios/Makefile b/flashbios/Makefile
new file mode 100644
index 0000000..4fdb4af
--- /dev/null
+++ b/flashbios/Makefile
@@ -0,0 +1,3 @@
+BINS=flash_bios
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/flash_bios_obj.c b/flashbios/flash_bios_obj.c
index f865be1..f865be1 100644
--- a/objects/flash_bios_obj.c
+++ b/flashbios/flash_bios_obj.c
diff --git a/gdbus.mk b/gdbus.mk
new file mode 100644
index 0000000..dcbf6c9
--- /dev/null
+++ b/gdbus.mk
@@ -0,0 +1,11 @@
+PACKAGE_DEPS=gio-unix-2.0 glib-2.0
+CFLAGS+=-iquote ../gdbus -iquote ../libopenbmc_intf
+
+LIBOBMC=$(TOP)/libopenbmc_intf/libopenbmc_intf.so.1
+EXTRA_OBJS+=$(LIBOBMC)
+
+$(LIBOBMC):
+ $(MAKE) -C $(TOP)/libopenbmc_intf
+
+%.o: %_obj.c
+ $(CC) -c $(CFLAGS) -fPIC -o $@ $<
diff --git a/codegen b/gdbus/codegen
index 0fb688e..0fb688e 100755
--- a/codegen
+++ b/gdbus/codegen
diff --git a/interfaces/openbmc_intf.c b/gdbus/interfaces/openbmc_intf.c
index 62b6016..62b6016 100644
--- a/interfaces/openbmc_intf.c
+++ b/gdbus/interfaces/openbmc_intf.c
diff --git a/interfaces/openbmc_intf.h b/gdbus/interfaces/openbmc_intf.h
index ac7603e..ac7603e 100644
--- a/interfaces/openbmc_intf.h
+++ b/gdbus/interfaces/openbmc_intf.h
diff --git a/xml/openbmc_intf.xml b/gdbus/xml/openbmc_intf.xml
index ead899c..ead899c 100644
--- a/xml/openbmc_intf.xml
+++ b/gdbus/xml/openbmc_intf.xml
diff --git a/hacks/Makefile b/hacks/Makefile
new file mode 100644
index 0000000..abb4ed3
--- /dev/null
+++ b/hacks/Makefile
@@ -0,0 +1,7 @@
+all:
+
+install:
+ mkdir -p $(DESTDIR)/usr/sbin
+ install startup_hacks.sh $(DESTDIR)/usr/sbin
+
+clean:
diff --git a/bin/startup_hacks.sh b/hacks/startup_hacks.sh
index 3a93e90..3a93e90 100755..100644
--- a/bin/startup_hacks.sh
+++ b/hacks/startup_hacks.sh
diff --git a/hostwatchdog/Makefile b/hostwatchdog/Makefile
new file mode 100644
index 0000000..d4d2ed3
--- /dev/null
+++ b/hostwatchdog/Makefile
@@ -0,0 +1,3 @@
+BINS=host_watchdog
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/host_watchdog_obj.c b/hostwatchdog/host_watchdog_obj.c
index e922dc3..e922dc3 100644
--- a/objects/host_watchdog_obj.c
+++ b/hostwatchdog/host_watchdog_obj.c
diff --git a/hwmon-barreleye/Makefile b/hwmon-barreleye/Makefile
new file mode 100644
index 0000000..4e89e3c
--- /dev/null
+++ b/hwmon-barreleye/Makefile
@@ -0,0 +1,3 @@
+BINS=hwmons_barreleye
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/hwmons_barreleye.c b/hwmon-barreleye/hwmons_barreleye.c
index 07717cf..07717cf 100644
--- a/objects/hwmons_barreleye.c
+++ b/hwmon-barreleye/hwmons_barreleye.c
diff --git a/hwmon/Makefile b/hwmon/Makefile
new file mode 100644
index 0000000..5b9a70f
--- /dev/null
+++ b/hwmon/Makefile
@@ -0,0 +1,3 @@
+BINS=hwmons_palmetto
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/hwmons_palmetto.c b/hwmon/hwmons_palmetto.c
index 7d76c91..7d76c91 100644
--- a/objects/hwmons_palmetto.c
+++ b/hwmon/hwmons_palmetto.c
diff --git a/includes/sensor_threshold.c b/includes/sensor_threshold.c
deleted file mode 100644
index adf8f5e..0000000
--- a/includes/sensor_threshold.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <argp.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-#include "sensor_threshold.h"
-#include "openbmc.h"
-
-gboolean
-get_threshold_state (SensorThreshold *sen,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- guint state = sensor_threshold_get_state(sen);
- sensor_threshold_complete_get_state(sen,invocation,state);
- return TRUE;
-}
-
-
-
-void check_thresholds(SensorThreshold* sensor,GVariant* value)
-{
- threshold_states current_state = sensor_threshold_get_state(sensor);
- //if (current_state != NOT_SET)
- //{
- threshold_states state = NORMAL;
- if (VARIANT_COMPARE(value,sensor_threshold_get_lower_critical(sensor)) < 0) {
- state = LOWER_CRITICAL;
- }
- else if(VARIANT_COMPARE(value,sensor_threshold_get_lower_warning(sensor)) < 0) {
- state = LOWER_WARNING;
- }
- else if(VARIANT_COMPARE(value,sensor_threshold_get_upper_critical(sensor)) > 0) {
- state = UPPER_CRITICAL;
- }
- else if(VARIANT_COMPARE(value,sensor_threshold_get_upper_warning(sensor)) > 0) {
- state = UPPER_WARNING;
- }
- // only emit signal if threshold state changes
- if (state != sensor_threshold_get_state(sensor))
- {
- sensor_threshold_set_state(sensor,state);
- if (state == LOWER_CRITICAL || state == UPPER_CRITICAL)
- {
- sensor_threshold_emit_critical(sensor);
- }
- else if (state == LOWER_WARNING || state == UPPER_WARNING)
- {
- sensor_threshold_emit_warning(sensor);
- }
- else if (state == NORMAL)
- {
- sensor_threshold_emit_normal(sensor);
- }
- }
- //}
-}
-
diff --git a/includes/sensor_threshold.h b/includes/sensor_threshold.h
deleted file mode 100644
index b02c8ca..0000000
--- a/includes/sensor_threshold.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __SENSOR_THRESHOLDS_H__
-#define __SENSOR_THRESHOLDS_H__
-
-#include <stdint.h>
-#include "interfaces/openbmc_intf.h"
-
-typedef enum { NOT_SET,NORMAL,LOWER_CRITICAL,LOWER_WARNING,UPPER_WARNING,UPPER_CRITICAL } threshold_states;
-
-gboolean get_threshold_state(SensorThreshold*,
- GDBusMethodInvocation*,gpointer);
-
-void check_thresholds(SensorThreshold*,GVariant*);
-
-
-#endif
diff --git a/ledctl/Makefile b/ledctl/Makefile
new file mode 100644
index 0000000..fa2b578
--- /dev/null
+++ b/ledctl/Makefile
@@ -0,0 +1,3 @@
+BINS=led_controller
+include ../sdbus.mk
+include ../rules.mk
diff --git a/objects/led_controller.c b/ledctl/led_controller.c
index 9eda9ee..9eda9ee 100644
--- a/objects/led_controller.c
+++ b/ledctl/led_controller.c
diff --git a/libopenbmc_intf/Makefile b/libopenbmc_intf/Makefile
new file mode 100644
index 0000000..9cd7be6
--- /dev/null
+++ b/libopenbmc_intf/Makefile
@@ -0,0 +1,20 @@
+PACKAGE_DEPS=gio-unix-2.0 glib-2.0
+INSTALLDEPS=install-lib
+CLEANDEPS=clean-lib
+DEFAULT_ALL=$(LIBOBMC)
+CFLAGS+=-iquote ../gdbus
+LIBOBMC=openbmc_intf
+
+$(LIBOBMC): %: %.o gpio.o
+ $(CC) -shared $(LDFLAGS) -Wl,-soname,lib$(LIBOBMC).so \
+ -o lib$@.so.1 $^ $(LDLIBS)
+
+install-lib:
+ @mkdir -p $(DESTDIR)$(libdir)
+ install lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)
+ ln -s lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)/lib$(LIBOBMC).so
+
+clean-lib:
+ rm -f lib$(LIBOBMC).so.1
+
+include ../rules.mk
diff --git a/includes/gpio.c b/libopenbmc_intf/gpio.c
index 25a9df8..25a9df8 100755..100644
--- a/includes/gpio.c
+++ b/libopenbmc_intf/gpio.c
diff --git a/includes/gpio.h b/libopenbmc_intf/gpio.h
index 8cfc59f..8cfc59f 100644
--- a/includes/gpio.h
+++ b/libopenbmc_intf/gpio.h
diff --git a/includes/openbmc.h b/libopenbmc_intf/openbmc.h
index c1c0335..c1c0335 100644
--- a/includes/openbmc.h
+++ b/libopenbmc_intf/openbmc.h
diff --git a/libopenbmc_intf/openbmc_intf.c b/libopenbmc_intf/openbmc_intf.c
new file mode 120000
index 0000000..3ac5de7
--- /dev/null
+++ b/libopenbmc_intf/openbmc_intf.c
@@ -0,0 +1 @@
+../gdbus/interfaces/openbmc_intf.c \ No newline at end of file
diff --git a/libopenbmc_intf/openbmc_intf.h b/libopenbmc_intf/openbmc_intf.h
new file mode 120000
index 0000000..957c7b7
--- /dev/null
+++ b/libopenbmc_intf/openbmc_intf.h
@@ -0,0 +1 @@
+../gdbus/interfaces/openbmc_intf.h \ No newline at end of file
diff --git a/objects/pflash/progress.o b/objects/pflash/progress.o
deleted file mode 100644
index 5153ecb..0000000
--- a/objects/pflash/progress.o
+++ /dev/null
Binary files differ
diff --git a/op-flasher/Makefile b/op-flasher/Makefile
new file mode 100644
index 0000000..80b9ccb
--- /dev/null
+++ b/op-flasher/Makefile
@@ -0,0 +1,14 @@
+BINS=flasher
+EXTRA_OBJS+=progress.o \
+ ast-sf-ctrl.o \
+ libflash.o \
+ libffs.o \
+ arm_io.o
+CFLAGS+=-Ipflash
+include ../gdbus.mk
+include ../rules.mk
+
+%.o: pflash/%.c
+ $(CC) -c -o $(CFLAGS) -fPIC -o $@ $<
+%.o: pflash/libflash/%.c
+ $(CC) -c -o $(CFLAGS) -fPIC -o $@ $<
diff --git a/objects/flasher_obj.c b/op-flasher/flasher_obj.c
index 56ca61f..95892bd 100644
--- a/objects/flasher_obj.c
+++ b/op-flasher/flasher_obj.c
@@ -21,7 +21,7 @@
#include "ast.h"
#include "sfc-ctrl.h"
#include "interfaces/openbmc_intf.h"
-#include "includes/openbmc.h"
+#include "openbmc.h"
static const gchar* dbus_object_path = "/org/openbmc/control";
static const gchar* dbus_name = "org.openbmc.control.Flasher";
diff --git a/objects/pflash/Makefile b/op-flasher/pflash/Makefile
index f77cee9..f77cee9 100644
--- a/objects/pflash/Makefile
+++ b/op-flasher/pflash/Makefile
diff --git a/objects/pflash/TODO b/op-flasher/pflash/TODO
index b30f36d..b30f36d 100644
--- a/objects/pflash/TODO
+++ b/op-flasher/pflash/TODO
diff --git a/objects/pflash/arm_io.c b/op-flasher/pflash/arm_io.c
index d97bd10..d97bd10 100644
--- a/objects/pflash/arm_io.c
+++ b/op-flasher/pflash/arm_io.c
diff --git a/objects/pflash/ast-sf-ctrl.c b/op-flasher/pflash/ast-sf-ctrl.c
index bf5d372..bf5d372 100644
--- a/objects/pflash/ast-sf-ctrl.c
+++ b/op-flasher/pflash/ast-sf-ctrl.c
diff --git a/objects/pflash/ast.h b/op-flasher/pflash/ast.h
index c7bf0cb..c7bf0cb 100644
--- a/objects/pflash/ast.h
+++ b/op-flasher/pflash/ast.h
diff --git a/objects/pflash/ccan/Makefile.inc b/op-flasher/pflash/ccan/Makefile.inc
index b132f9d..b132f9d 100644
--- a/objects/pflash/ccan/Makefile.inc
+++ b/op-flasher/pflash/ccan/Makefile.inc
diff --git a/objects/pflash/ccan/array_size/LICENSE b/op-flasher/pflash/ccan/array_size/LICENSE
index feb9b11..feb9b11 100644
--- a/objects/pflash/ccan/array_size/LICENSE
+++ b/op-flasher/pflash/ccan/array_size/LICENSE
diff --git a/objects/pflash/ccan/array_size/_info b/op-flasher/pflash/ccan/array_size/_info
index d670042..d670042 100644
--- a/objects/pflash/ccan/array_size/_info
+++ b/op-flasher/pflash/ccan/array_size/_info
diff --git a/objects/pflash/ccan/array_size/array_size.h b/op-flasher/pflash/ccan/array_size/array_size.h
index 3279dc5..3279dc5 100644
--- a/objects/pflash/ccan/array_size/array_size.h
+++ b/op-flasher/pflash/ccan/array_size/array_size.h
diff --git a/objects/pflash/ccan/array_size/test/compile_fail-function-param.c b/op-flasher/pflash/ccan/array_size/test/compile_fail-function-param.c
index ec4697d..ec4697d 100644
--- a/objects/pflash/ccan/array_size/test/compile_fail-function-param.c
+++ b/op-flasher/pflash/ccan/array_size/test/compile_fail-function-param.c
diff --git a/objects/pflash/ccan/array_size/test/compile_fail.c b/op-flasher/pflash/ccan/array_size/test/compile_fail.c
index 0ba493d..0ba493d 100644
--- a/objects/pflash/ccan/array_size/test/compile_fail.c
+++ b/op-flasher/pflash/ccan/array_size/test/compile_fail.c
diff --git a/objects/pflash/ccan/array_size/test/run.c b/op-flasher/pflash/ccan/array_size/test/run.c
index b42dd72..b42dd72 100644
--- a/objects/pflash/ccan/array_size/test/run.c
+++ b/op-flasher/pflash/ccan/array_size/test/run.c
diff --git a/objects/pflash/ccan/build_assert/LICENSE b/op-flasher/pflash/ccan/build_assert/LICENSE
index feb9b11..feb9b11 100644
--- a/objects/pflash/ccan/build_assert/LICENSE
+++ b/op-flasher/pflash/ccan/build_assert/LICENSE
diff --git a/objects/pflash/ccan/build_assert/_info b/op-flasher/pflash/ccan/build_assert/_info
index bce92b7..bce92b7 100644
--- a/objects/pflash/ccan/build_assert/_info
+++ b/op-flasher/pflash/ccan/build_assert/_info
diff --git a/objects/pflash/ccan/build_assert/build_assert.h b/op-flasher/pflash/ccan/build_assert/build_assert.h
index bd07254..bd07254 100644
--- a/objects/pflash/ccan/build_assert/build_assert.h
+++ b/op-flasher/pflash/ccan/build_assert/build_assert.h
diff --git a/objects/pflash/ccan/build_assert/test/compile_fail-expr.c b/op-flasher/pflash/ccan/build_assert/test/compile_fail-expr.c
index 1c6e31c..1c6e31c 100644
--- a/objects/pflash/ccan/build_assert/test/compile_fail-expr.c
+++ b/op-flasher/pflash/ccan/build_assert/test/compile_fail-expr.c
diff --git a/objects/pflash/ccan/build_assert/test/compile_fail.c b/op-flasher/pflash/ccan/build_assert/test/compile_fail.c
index f29c3fd..f29c3fd 100644
--- a/objects/pflash/ccan/build_assert/test/compile_fail.c
+++ b/op-flasher/pflash/ccan/build_assert/test/compile_fail.c
diff --git a/objects/pflash/ccan/build_assert/test/compile_ok.c b/op-flasher/pflash/ccan/build_assert/test/compile_ok.c
index 20c2af6..20c2af6 100644
--- a/objects/pflash/ccan/build_assert/test/compile_ok.c
+++ b/op-flasher/pflash/ccan/build_assert/test/compile_ok.c
diff --git a/objects/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c b/op-flasher/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
index a5450f1..a5450f1 100644
--- a/objects/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
+++ b/op-flasher/pflash/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
diff --git a/objects/pflash/ccan/built-in.o b/op-flasher/pflash/ccan/built-in.o
index 510b477..510b477 100644
--- a/objects/pflash/ccan/built-in.o
+++ b/op-flasher/pflash/ccan/built-in.o
Binary files differ
diff --git a/objects/pflash/ccan/check_type/LICENSE b/op-flasher/pflash/ccan/check_type/LICENSE
index feb9b11..feb9b11 100644
--- a/objects/pflash/ccan/check_type/LICENSE
+++ b/op-flasher/pflash/ccan/check_type/LICENSE
diff --git a/objects/pflash/ccan/check_type/_info b/op-flasher/pflash/ccan/check_type/_info
index cb19e20..cb19e20 100644
--- a/objects/pflash/ccan/check_type/_info
+++ b/op-flasher/pflash/ccan/check_type/_info
diff --git a/objects/pflash/ccan/check_type/check_type.h b/op-flasher/pflash/ccan/check_type/check_type.h
index ef4a9b3..ef4a9b3 100644
--- a/objects/pflash/ccan/check_type/check_type.h
+++ b/op-flasher/pflash/ccan/check_type/check_type.h
diff --git a/objects/pflash/ccan/check_type/test/compile_fail-check_type.c b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_type.c
index 00dad58..00dad58 100644
--- a/objects/pflash/ccan/check_type/test/compile_fail-check_type.c
+++ b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_type.c
diff --git a/objects/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c
index 8c0227a..8c0227a 100644
--- a/objects/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c
+++ b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_type_unsigned.c
diff --git a/objects/pflash/ccan/check_type/test/compile_fail-check_types_match.c b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_types_match.c
index 081304f..081304f 100644
--- a/objects/pflash/ccan/check_type/test/compile_fail-check_types_match.c
+++ b/op-flasher/pflash/ccan/check_type/test/compile_fail-check_types_match.c
diff --git a/objects/pflash/ccan/check_type/test/run.c b/op-flasher/pflash/ccan/check_type/test/run.c
index eb99632..eb99632 100644
--- a/objects/pflash/ccan/check_type/test/run.c
+++ b/op-flasher/pflash/ccan/check_type/test/run.c
diff --git a/objects/pflash/ccan/container_of/LICENSE b/op-flasher/pflash/ccan/container_of/LICENSE
index feb9b11..feb9b11 100644
--- a/objects/pflash/ccan/container_of/LICENSE
+++ b/op-flasher/pflash/ccan/container_of/LICENSE
diff --git a/objects/pflash/ccan/container_of/_info b/op-flasher/pflash/ccan/container_of/_info
index 77b3bd1..77b3bd1 100644
--- a/objects/pflash/ccan/container_of/_info
+++ b/op-flasher/pflash/ccan/container_of/_info
diff --git a/objects/pflash/ccan/container_of/container_of.h b/op-flasher/pflash/ccan/container_of/container_of.h
index bc53dfb..bc53dfb 100644
--- a/objects/pflash/ccan/container_of/container_of.h
+++ b/op-flasher/pflash/ccan/container_of/container_of.h
diff --git a/objects/pflash/ccan/container_of/test/compile_fail-bad-type.c b/op-flasher/pflash/ccan/container_of/test/compile_fail-bad-type.c
index 9ee8e9f..9ee8e9f 100644
--- a/objects/pflash/ccan/container_of/test/compile_fail-bad-type.c
+++ b/op-flasher/pflash/ccan/container_of/test/compile_fail-bad-type.c
diff --git a/objects/pflash/ccan/container_of/test/compile_fail-types.c b/op-flasher/pflash/ccan/container_of/test/compile_fail-types.c
index acd57c7..acd57c7 100644
--- a/objects/pflash/ccan/container_of/test/compile_fail-types.c
+++ b/op-flasher/pflash/ccan/container_of/test/compile_fail-types.c
diff --git a/objects/pflash/ccan/container_of/test/compile_fail-var-types.c b/op-flasher/pflash/ccan/container_of/test/compile_fail-var-types.c
index 60f25bd..60f25bd 100644
--- a/objects/pflash/ccan/container_of/test/compile_fail-var-types.c
+++ b/op-flasher/pflash/ccan/container_of/test/compile_fail-var-types.c
diff --git a/objects/pflash/ccan/container_of/test/run.c b/op-flasher/pflash/ccan/container_of/test/run.c
index bc87789..bc87789 100644
--- a/objects/pflash/ccan/container_of/test/run.c
+++ b/op-flasher/pflash/ccan/container_of/test/run.c
diff --git a/objects/pflash/ccan/endian/LICENSE b/op-flasher/pflash/ccan/endian/LICENSE
index feb9b11..feb9b11 100644
--- a/objects/pflash/ccan/endian/LICENSE
+++ b/op-flasher/pflash/ccan/endian/LICENSE
diff --git a/objects/pflash/ccan/endian/_info b/op-flasher/pflash/ccan/endian/_info
index 753afa7..753afa7 100644
--- a/objects/pflash/ccan/endian/_info
+++ b/op-flasher/pflash/ccan/endian/_info
diff --git a/objects/pflash/ccan/endian/endian.h b/op-flasher/pflash/ccan/endian/endian.h
index 39c5308..39c5308 100644
--- a/objects/pflash/ccan/endian/endian.h
+++ b/op-flasher/pflash/ccan/endian/endian.h
diff --git a/objects/pflash/ccan/endian/test/compile_ok-constant.c b/op-flasher/pflash/ccan/endian/test/compile_ok-constant.c
index 93b5a03..93b5a03 100644
--- a/objects/pflash/ccan/endian/test/compile_ok-constant.c
+++ b/op-flasher/pflash/ccan/endian/test/compile_ok-constant.c
diff --git a/objects/pflash/ccan/endian/test/run.c b/op-flasher/pflash/ccan/endian/test/run.c
index 8604068..8604068 100644
--- a/objects/pflash/ccan/endian/test/run.c
+++ b/op-flasher/pflash/ccan/endian/test/run.c
diff --git a/objects/pflash/config.h b/op-flasher/pflash/config.h
index 8af0bbe..8af0bbe 100644
--- a/objects/pflash/config.h
+++ b/op-flasher/pflash/config.h
diff --git a/objects/pflash/get_arch.sh b/op-flasher/pflash/get_arch.sh
index 18a5cef..18a5cef 100644
--- a/objects/pflash/get_arch.sh
+++ b/op-flasher/pflash/get_arch.sh
diff --git a/objects/pflash/io.h b/op-flasher/pflash/io.h
index f855717..f855717 100644
--- a/objects/pflash/io.h
+++ b/op-flasher/pflash/io.h
diff --git a/objects/pflash/libflash/ffs.h b/op-flasher/pflash/libflash/ffs.h
index 36b0b00..36b0b00 100644
--- a/objects/pflash/libflash/ffs.h
+++ b/op-flasher/pflash/libflash/ffs.h
diff --git a/objects/pflash/libflash/libffs.c b/op-flasher/pflash/libflash/libffs.c
index db7104d..db7104d 100644
--- a/objects/pflash/libflash/libffs.c
+++ b/op-flasher/pflash/libflash/libffs.c
diff --git a/objects/pflash/libflash/libffs.h b/op-flasher/pflash/libflash/libffs.h
index 9853987..9853987 100644
--- a/objects/pflash/libflash/libffs.h
+++ b/op-flasher/pflash/libflash/libffs.h
diff --git a/objects/pflash/libflash/libflash-priv.h b/op-flasher/pflash/libflash/libflash-priv.h
index cf40e2e..cf40e2e 100644
--- a/objects/pflash/libflash/libflash-priv.h
+++ b/op-flasher/pflash/libflash/libflash-priv.h
diff --git a/objects/pflash/libflash/libflash.c b/op-flasher/pflash/libflash/libflash.c
index 762d9e7..762d9e7 100644
--- a/objects/pflash/libflash/libflash.c
+++ b/op-flasher/pflash/libflash/libflash.c
diff --git a/objects/pflash/libflash/libflash.h b/op-flasher/pflash/libflash/libflash.h
index a341c54..a341c54 100644
--- a/objects/pflash/libflash/libflash.h
+++ b/op-flasher/pflash/libflash/libflash.h
diff --git a/objects/pflash/libflash/test/Makefile b/op-flasher/pflash/libflash/test/Makefile
index e357e20..e357e20 100644
--- a/objects/pflash/libflash/test/Makefile
+++ b/op-flasher/pflash/libflash/test/Makefile
diff --git a/objects/pflash/libflash/test/test-flash.c b/op-flasher/pflash/libflash/test/test-flash.c
index 0e92d8c..0e92d8c 100644
--- a/objects/pflash/libflash/test/test-flash.c
+++ b/op-flasher/pflash/libflash/test/test-flash.c
diff --git a/objects/pflash/pflash.c b/op-flasher/pflash/pflash.c
index 09359fb..09359fb 100644
--- a/objects/pflash/pflash.c
+++ b/op-flasher/pflash/pflash.c
diff --git a/objects/pflash/powerpc_io.c b/op-flasher/pflash/powerpc_io.c
index 1aa224b..1aa224b 100644
--- a/objects/pflash/powerpc_io.c
+++ b/op-flasher/pflash/powerpc_io.c
diff --git a/objects/pflash/progress.c b/op-flasher/pflash/progress.c
index 3ca644f..3ca644f 100644
--- a/objects/pflash/progress.c
+++ b/op-flasher/pflash/progress.c
diff --git a/objects/pflash/progress.h b/op-flasher/pflash/progress.h
index 3b6137a..3b6137a 100644
--- a/objects/pflash/progress.h
+++ b/op-flasher/pflash/progress.h
diff --git a/objects/pflash/sfc-ctrl.c b/op-flasher/pflash/sfc-ctrl.c
index dfcda20..dfcda20 100644
--- a/objects/pflash/sfc-ctrl.c
+++ b/op-flasher/pflash/sfc-ctrl.c
diff --git a/objects/pflash/sfc-ctrl.h b/op-flasher/pflash/sfc-ctrl.h
index 77ccd42..77ccd42 100644
--- a/objects/pflash/sfc-ctrl.h
+++ b/op-flasher/pflash/sfc-ctrl.h
diff --git a/op-hostctl/Makefile b/op-hostctl/Makefile
new file mode 100644
index 0000000..99f63dc
--- /dev/null
+++ b/op-hostctl/Makefile
@@ -0,0 +1,3 @@
+BINS=control_host
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/control_host_obj.c b/op-hostctl/control_host_obj.c
index e65f0af..e65f0af 100755..100644
--- a/objects/control_host_obj.c
+++ b/op-hostctl/control_host_obj.c
diff --git a/op-pwrctl/Makefile b/op-pwrctl/Makefile
new file mode 100644
index 0000000..b1188ae
--- /dev/null
+++ b/op-pwrctl/Makefile
@@ -0,0 +1,3 @@
+BINS=power_control
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/power_control_obj.c b/op-pwrctl/power_control_obj.c
index 85a8cff..85a8cff 100644
--- a/objects/power_control_obj.c
+++ b/op-pwrctl/power_control_obj.c
diff --git a/pciedetect/Makefile b/pciedetect/Makefile
new file mode 100644
index 0000000..21aaadc
--- /dev/null
+++ b/pciedetect/Makefile
@@ -0,0 +1,3 @@
+BINS=pcie_slot_present
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/pcie_slot_present_obj.c b/pciedetect/pcie_slot_present_obj.c
index 36104e2..36104e2 100644
--- a/objects/pcie_slot_present_obj.c
+++ b/pciedetect/pcie_slot_present_obj.c
diff --git a/pwrbutton/Makefile b/pwrbutton/Makefile
new file mode 100644
index 0000000..a92236f
--- /dev/null
+++ b/pwrbutton/Makefile
@@ -0,0 +1,3 @@
+BINS=button_power
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/button_power_obj.c b/pwrbutton/button_power_obj.c
index e093a00..e093a00 100644
--- a/objects/button_power_obj.c
+++ b/pwrbutton/button_power_obj.c
diff --git a/py.mk b/py.mk
new file mode 100644
index 0000000..9669fce
--- /dev/null
+++ b/py.mk
@@ -0,0 +1,9 @@
+PYTHON?=python
+all:
+ $(PYTHON) setup.py build
+
+clean:
+ rm -rf build
+
+install: all
+ $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
diff --git a/pychassisctl/Makefile b/pychassisctl/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pychassisctl/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/chassis_control.py b/pychassisctl/chassis_control.py
index 376e0e9..376e0e9 100755..100644
--- a/bin/chassis_control.py
+++ b/pychassisctl/chassis_control.py
diff --git a/pychassisctl/setup.cfg b/pychassisctl/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pychassisctl/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pychassisctl/setup.py b/pychassisctl/setup.py
new file mode 100644
index 0000000..b86c7e8
--- /dev/null
+++ b/pychassisctl/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pychassisctl',
+ version='1.0',
+ scripts=['chassis_control.py'],
+ )
diff --git a/pydownloadmgr/Makefile b/pydownloadmgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pydownloadmgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/download_manager.py b/pydownloadmgr/download_manager.py
index ba502da..ba502da 100755..100644
--- a/bin/download_manager.py
+++ b/pydownloadmgr/download_manager.py
diff --git a/pydownloadmgr/setup.cfg b/pydownloadmgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pydownloadmgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pydownloadmgr/setup.py b/pydownloadmgr/setup.py
new file mode 100644
index 0000000..35c8b6d
--- /dev/null
+++ b/pydownloadmgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pydownloadmgr',
+ version='1.0',
+ scripts=['download_manager.py'],
+ )
diff --git a/pyfanctl/Makefile b/pyfanctl/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pyfanctl/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/fan_control.py b/pyfanctl/fan_control.py
index cea2215..cea2215 100755..100644
--- a/bin/fan_control.py
+++ b/pyfanctl/fan_control.py
diff --git a/pyfanctl/setup.cfg b/pyfanctl/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pyfanctl/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pyfanctl/setup.py b/pyfanctl/setup.py
new file mode 100644
index 0000000..655808d
--- /dev/null
+++ b/pyfanctl/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pyfanctl',
+ version='1.0',
+ scripts=['fan_control.py'],
+ )
diff --git a/pyflashbmc/Makefile b/pyflashbmc/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pyflashbmc/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/bmc_update.py b/pyflashbmc/bmc_update.py
index 9fa54ac..9fa54ac 100755..100644
--- a/bin/bmc_update.py
+++ b/pyflashbmc/bmc_update.py
diff --git a/pyflashbmc/setup.cfg b/pyflashbmc/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pyflashbmc/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pyflashbmc/setup.py b/pyflashbmc/setup.py
new file mode 100644
index 0000000..ed86cbb
--- /dev/null
+++ b/pyflashbmc/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pyflashbmc',
+ version='1.0',
+ scripts=['bmc_update.py'],
+ )
diff --git a/pyhwmon/Makefile b/pyhwmon/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pyhwmon/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/hwmon.py b/pyhwmon/hwmon.py
index 9f4b1d9..9f4b1d9 100755..100644
--- a/bin/hwmon.py
+++ b/pyhwmon/hwmon.py
diff --git a/pyhwmon/setup.cfg b/pyhwmon/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pyhwmon/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pyhwmon/setup.py b/pyhwmon/setup.py
new file mode 100644
index 0000000..41b3b9a
--- /dev/null
+++ b/pyhwmon/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pyhwmon',
+ version='1.0',
+ scripts=['hwmon.py'],
+ )
diff --git a/pyinventorymgr/Makefile b/pyinventorymgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pyinventorymgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/inventory_items.py b/pyinventorymgr/inventory_items.py
index 5e53293..5e53293 100755..100644
--- a/bin/inventory_items.py
+++ b/pyinventorymgr/inventory_items.py
diff --git a/pyinventorymgr/setup.cfg b/pyinventorymgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pyinventorymgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pyinventorymgr/setup.py b/pyinventorymgr/setup.py
new file mode 100644
index 0000000..851d961
--- /dev/null
+++ b/pyinventorymgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pyinventorymgr',
+ version='1.0',
+ scripts=['inventory_items.py'],
+ )
diff --git a/pyipmitest/Makefile b/pyipmitest/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pyipmitest/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/ipmi_debug.py b/pyipmitest/ipmi_debug.py
index 0fc6a86..0fc6a86 100755..100644
--- a/bin/ipmi_debug.py
+++ b/pyipmitest/ipmi_debug.py
diff --git a/pyipmitest/setup.cfg b/pyipmitest/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pyipmitest/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pyipmitest/setup.py b/pyipmitest/setup.py
new file mode 100644
index 0000000..37957b8
--- /dev/null
+++ b/pyipmitest/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pyipmitest',
+ version='1.0',
+ scripts=['ipmi_debug.py'],
+ )
diff --git a/pysensormgr/Makefile b/pysensormgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pysensormgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/sensor_manager2.py b/pysensormgr/sensor_manager2.py
index fa3638a..fa3638a 100755..100644
--- a/bin/sensor_manager2.py
+++ b/pysensormgr/sensor_manager2.py
diff --git a/pysensormgr/setup.cfg b/pysensormgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pysensormgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pysensormgr/setup.py b/pysensormgr/setup.py
new file mode 100644
index 0000000..7944841
--- /dev/null
+++ b/pysensormgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pysensormgr',
+ version='1.0',
+ scripts=['sensor_manager2.py'],
+ )
diff --git a/pystatemgr/Makefile b/pystatemgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pystatemgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/discover_system_state.py b/pystatemgr/discover_system_state.py
index 5bd8fdc..5bd8fdc 100755..100644
--- a/bin/discover_system_state.py
+++ b/pystatemgr/discover_system_state.py
diff --git a/bin/goto_system_state.py b/pystatemgr/goto_system_state.py
index 4efa1c6..4efa1c6 100644
--- a/bin/goto_system_state.py
+++ b/pystatemgr/goto_system_state.py
diff --git a/pystatemgr/setup.cfg b/pystatemgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pystatemgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pystatemgr/setup.py b/pystatemgr/setup.py
new file mode 100644
index 0000000..86c7471
--- /dev/null
+++ b/pystatemgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pystatemgr',
+ version='1.0',
+ scripts=['discover_system_state.py', 'goto_system_state.py'],
+ )
diff --git a/pysystemmgr/Makefile b/pysystemmgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pysystemmgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/pysystemmgr/setup.cfg b/pysystemmgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pysystemmgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pysystemmgr/setup.py b/pysystemmgr/setup.py
new file mode 100644
index 0000000..4207620
--- /dev/null
+++ b/pysystemmgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pysystemmgr',
+ version='1.0',
+ scripts=['system_manager.py'],
+ )
diff --git a/bin/system_manager.py b/pysystemmgr/system_manager.py
index 754700b..754700b 100755..100644
--- a/bin/system_manager.py
+++ b/pysystemmgr/system_manager.py
diff --git a/pytools/Makefile b/pytools/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pytools/Makefile
@@ -0,0 +1 @@
+../Makefile.python \ No newline at end of file
diff --git a/bin/gpioutil b/pytools/gpioutil
index ab44b4d..ab44b4d 100755..100644
--- a/bin/gpioutil
+++ b/pytools/gpioutil
diff --git a/bin/obmcutil b/pytools/obmcutil
index bd753ca..bd753ca 100755..100644
--- a/bin/obmcutil
+++ b/pytools/obmcutil
diff --git a/pytools/setup.cfg b/pytools/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pytools/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg \ No newline at end of file
diff --git a/pytools/setup.py b/pytools/setup.py
new file mode 100644
index 0000000..2736366
--- /dev/null
+++ b/pytools/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pytools',
+ version='1.0',
+ scripts=['obmcutil', 'gpioutil'],
+ )
diff --git a/rstbutton/Makefile b/rstbutton/Makefile
new file mode 100644
index 0000000..906b099
--- /dev/null
+++ b/rstbutton/Makefile
@@ -0,0 +1,3 @@
+BINS=button_reset
+include ../gdbus.mk
+include ../rules.mk
diff --git a/objects/button_reset_obj.c b/rstbutton/button_reset_obj.c
index a9321e3..a9321e3 100644
--- a/objects/button_reset_obj.c
+++ b/rstbutton/button_reset_obj.c
diff --git a/rules.mk b/rules.mk
new file mode 100644
index 0000000..9cad8cf
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,31 @@
+TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+
+.DEFAULT_GOAL := all
+sbindir=/usr/sbin
+libdir=/usr/lib
+
+LDLIBS+=$(shell pkg-config --libs $(PACKAGE_DEPS))
+CFLAGS+=$(shell pkg-config --cflags $(PACKAGE_DEPS)) -Werror
+
+INSTALLDEPS?=install-bins
+BIN_SUFFIX?=.exe
+DEFAULT_ALL?=$(BINS)
+
+all: $(DEFAULT_ALL)
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) -fPIC -o $@ $<
+
+$(BINS): %: %.o $(EXTRA_OBJS)
+ $(CC) $(LDFLAGS) -o $@$(BIN_SUFFIX) $^ $(LDLIBS)
+
+install-bins:
+ @mkdir -p $(DESTDIR)$(sbindir)
+ @for b in $(BINS); do \
+ install $$b$(BIN_SUFFIX) $(DESTDIR)$(sbindir) || exit 1; \
+ done
+
+install: all $(INSTALLDEPS)
+
+clean: $(CLEANDEPS)
+ rm -rf *.o $(BINS:=$(BIN_SUFFIX))
diff --git a/sdbus.mk b/sdbus.mk
new file mode 100644
index 0000000..67ad125
--- /dev/null
+++ b/sdbus.mk
@@ -0,0 +1 @@
+PACKAGE_DEPS=libsystemd
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..ed3bf6e
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[install]
+install_scripts=/usr/sbin
OpenPOWER on IntegriCloud