summaryrefslogtreecommitdiffstats
path: root/Makefile
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 /Makefile
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>
Diffstat (limited to 'Makefile')
-rw-r--r--[-rwxr-xr-x]Makefile128
1 files changed, 51 insertions, 77 deletions
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
OpenPOWER on IntegriCloud