Skip to content

Commit 40a360c

Browse files
committed
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 <[email protected]>
1 parent a731221 commit 40a360c

File tree

162 files changed

+292
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+292
-173
lines changed

.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
lib/*
2-
obj/*
3-
bin/*.exe
4-
bin/pflash
1+
*.exe
2+
*.o
3+
*.so
4+
*.so.*
55
*.swp
66
*.swo
7+
*/build

Makefile

100755100644
+51-77
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,51 @@
1-
#CC=gcc
2-
OBJS = objects/pflash/progress.o objects/pflash/ast-sf-ctrl.o
3-
OBJS += objects/pflash/libflash/libflash.o objects/pflash/libflash/libffs.o
4-
OBJS += objects/pflash/arm_io.o
5-
OBJS2 = progress.o ast-sf-ctrl.o libflash.o libffs.o arm_io.o
6-
OBJS3 = obj/progress.o obj/ast-sf-ctrl.o obj/libflash.o obj/libffs.o obj/arm_io.o
7-
INCLUDES=$(shell pkg-config --cflags gio-unix-2.0 glib-2.0) -Iincludes -Iobjects/pflash -I.
8-
LIBS=$(shell pkg-config --libs gio-unix-2.0 glib-2.0) -Llib -lopenbmc_intf
9-
INCLUDES += $(shell pkg-config --cflags --libs libsystemd) -I. -O2
10-
LIB_FLAG += $(shell pkg-config --libs libsystemd)
11-
12-
%.o: interfaces/%.c
13-
$(CC) -c -fPIC -o obj/$@ $< $(CFLAGS) $(INCLUDES)
14-
15-
%.o: objects/%.c
16-
$(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
17-
18-
%.o: includes/%.c
19-
$(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
20-
21-
%.o: objects/pflash/%.c
22-
$(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
23-
24-
%.o: objects/pflash/libflash/%.c
25-
$(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
26-
27-
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
28-
29-
setup:
30-
mkdir -p obj lib
31-
32-
clean:
33-
rm -rf obj lib bin/*.exe
34-
35-
libopenbmc_intf: openbmc_intf.o
36-
$(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(LDFLAGS)
37-
38-
power_control: power_control_obj.o gpio.o libopenbmc_intf
39-
$(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o $(LDFLAGS) $(LIBS)
40-
41-
led_controller: led_controller.o
42-
$(CC) -o bin/$@.exe obj/led_controller.o $(LDFLAGS) $(LIB_FLAG)
43-
44-
button_power: button_power_obj.o gpio.o libopenbmc_intf
45-
$(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
46-
47-
button_reset: button_reset_obj.o gpio.o libopenbmc_intf
48-
$(CC) -o bin/$@.exe obj/button_reset_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
49-
50-
51-
control_host: control_host_obj.o gpio.o libopenbmc_intf
52-
$(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o $(LDFLAGS) $(LIBS)
53-
54-
flash_bios: flash_bios_obj.o libopenbmc_intf
55-
$(CC) -o bin/$@.exe obj/flash_bios_obj.o $(LDFLAGS) $(LIBS)
56-
57-
host_watchdog: host_watchdog_obj.o libopenbmc_intf
58-
$(CC) -o bin/$@.exe obj/host_watchdog_obj.o $(LDFLAGS) $(LIBS)
59-
60-
board_vpd: board_vpd_obj.o libopenbmc_intf
61-
$(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS)
62-
63-
pcie_slot_present: pcie_slot_present_obj.o gpio.o libopenbmc_intf
64-
$(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
65-
66-
flasher: $(OBJS2) flasher_obj.o libopenbmc_intf
67-
$(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS)
68-
69-
pflash: $(OBJS2) pflash.o
70-
$(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS)
71-
72-
hwmons_barreleye: hwmons_barreleye.o libopenbmc_intf
73-
$(CC) -o bin/$@.exe obj/hwmons_barreleye.o $(LDFLAGS) $(LIBS)
74-
75-
control_bmc: control_bmc_obj.o libopenbmc_intf
76-
$(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS)
77-
1+
GDBUS_APPS = bmcctl \
2+
bmcctl-barreleye \
3+
boardvpd \
4+
fanctl \
5+
flashbios \
6+
hostwatchdog \
7+
hwmon \
8+
hwmon-barreleye \
9+
op-flasher \
10+
op-hostctl \
11+
op-pwrctl \
12+
pciedetect \
13+
pwrbutton \
14+
rstbutton
15+
16+
SUBDIRS = $(GDBUS_APPS) \
17+
configs \
18+
hacks \
19+
ledctl \
20+
libopenbmc_intf \
21+
pychassisctl \
22+
pydownloadmgr \
23+
pyfanctl \
24+
pyflashbmc \
25+
pyhwmon \
26+
pyinventorymgr \
27+
pyipmitest \
28+
pysensormgr \
29+
pystatemgr \
30+
pysystemmgr \
31+
pytools
32+
33+
REVERSE_SUBDIRS = $(shell echo $(SUBDIRS) | tr ' ' '\n' | tac |tr '\n' ' ')
34+
35+
.PHONY: subdirs $(SUBDIRS)
36+
37+
subdirs: $(SUBDIRS)
38+
39+
$(SUBDIRS):
40+
$(MAKE) -C $@
41+
42+
$(GDBUS_APPS): libopenbmc_intf
43+
44+
install: subdirs
45+
@for d in $(SUBDIRS); do \
46+
$(MAKE) -C $$d $@ DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) || exit 1; \
47+
done
48+
clean:
49+
@for d in $(REVERSE_SUBDIRS); do \
50+
$(MAKE) -C $$d $@ || exit 1; \
51+
done

Makefile.python

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../py.mk

bin/hconsole

-13
This file was deleted.

bmcctl-barreleye/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=control_bmc_barreleye
2+
include ../gdbus.mk
3+
include ../rules.mk

bmcctl/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=control_bmc
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

boardvpd/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=board_vpd
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

configs/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Makefile.python
File renamed without changes.

configs/setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from distutils.core import setup
2+
3+
setup(name='openbmc_configs',
4+
version='1.0',
5+
py_modules=['Palmetto', 'Garrison', 'Barreleye', 'Firestone', 'Witherspoon'],
6+
)

fanctl/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=fan_generic
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

flashbios/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=flash_bios
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

gdbus.mk

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PACKAGE_DEPS=gio-unix-2.0 glib-2.0
2+
CFLAGS+=-iquote ../gdbus -iquote ../libopenbmc_intf
3+
4+
LIBOBMC=$(TOP)/libopenbmc_intf/libopenbmc_intf.so.1
5+
EXTRA_OBJS+=$(LIBOBMC)
6+
7+
$(LIBOBMC):
8+
$(MAKE) -C $(TOP)/libopenbmc_intf
9+
10+
%.o: %_obj.c
11+
$(CC) -c $(CFLAGS) -fPIC -o $@ $<

codegen renamed to gdbus/codegen

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

hacks/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all:
2+
3+
install:
4+
mkdir -p $(DESTDIR)/usr/sbin
5+
install startup_hacks.sh $(DESTDIR)/usr/sbin
6+
7+
clean:
File renamed without changes.

hostwatchdog/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=host_watchdog
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

hwmon-barreleye/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=hwmons_barreleye
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

hwmon/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=hwmons_palmetto
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

includes/sensor_threshold.c

-63
This file was deleted.

includes/sensor_threshold.h

-15
This file was deleted.

ledctl/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=led_controller
2+
include ../sdbus.mk
3+
include ../rules.mk
File renamed without changes.

libopenbmc_intf/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
PACKAGE_DEPS=gio-unix-2.0 glib-2.0
2+
INSTALLDEPS=install-lib
3+
CLEANDEPS=clean-lib
4+
DEFAULT_ALL=$(LIBOBMC)
5+
CFLAGS+=-iquote ../gdbus
6+
LIBOBMC=openbmc_intf
7+
8+
$(LIBOBMC): %: %.o gpio.o
9+
$(CC) -shared $(LDFLAGS) -Wl,-soname,lib$(LIBOBMC).so \
10+
-o lib$@.so.1 $^ $(LDLIBS)
11+
12+
install-lib:
13+
@mkdir -p $(DESTDIR)$(libdir)
14+
install lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)
15+
ln -s lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)/lib$(LIBOBMC).so
16+
17+
clean-lib:
18+
rm -f lib$(LIBOBMC).so.1
19+
20+
include ../rules.mk
File renamed without changes.
File renamed without changes.
File renamed without changes.

libopenbmc_intf/openbmc_intf.c

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gdbus/interfaces/openbmc_intf.c

libopenbmc_intf/openbmc_intf.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gdbus/interfaces/openbmc_intf.h

objects/pflash/progress.o

-3.52 KB
Binary file not shown.

op-flasher/Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
BINS=flasher
2+
EXTRA_OBJS+=progress.o \
3+
ast-sf-ctrl.o \
4+
libflash.o \
5+
libffs.o \
6+
arm_io.o
7+
CFLAGS+=-Ipflash
8+
include ../gdbus.mk
9+
include ../rules.mk
10+
11+
%.o: pflash/%.c
12+
$(CC) -c -o $(CFLAGS) -fPIC -o $@ $<
13+
%.o: pflash/libflash/%.c
14+
$(CC) -c -o $(CFLAGS) -fPIC -o $@ $<

objects/flasher_obj.c renamed to op-flasher/flasher_obj.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "ast.h"
2222
#include "sfc-ctrl.h"
2323
#include "interfaces/openbmc_intf.h"
24-
#include "includes/openbmc.h"
24+
#include "openbmc.h"
2525

2626
static const gchar* dbus_object_path = "/org/openbmc/control";
2727
static const gchar* dbus_name = "org.openbmc.control.Flasher";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

op-hostctl/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=control_host
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

op-pwrctl/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=power_control
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

pciedetect/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=pcie_slot_present
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

pwrbutton/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BINS=button_power
2+
include ../gdbus.mk
3+
include ../rules.mk
File renamed without changes.

py.mk

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PYTHON?=python
2+
all:
3+
$(PYTHON) setup.py build
4+
5+
clean:
6+
rm -rf build
7+
8+
install: all
9+
$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)

pychassisctl/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Makefile.python
File renamed without changes.

pychassisctl/setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../setup.cfg

pychassisctl/setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from distutils.core import setup
2+
3+
setup(name='pychassisctl',
4+
version='1.0',
5+
scripts=['chassis_control.py'],
6+
)

pydownloadmgr/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Makefile.python
File renamed without changes.

pydownloadmgr/setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../setup.cfg

0 commit comments

Comments
 (0)