lots of changes
diff --git a/Makefile b/Makefile
index ab95652..8a2f6a9 100644
--- a/Makefile
+++ b/Makefile
@@ -3,14 +3,15 @@
OBJS += objects/pflash/libflash/libflash.o objects/pflash/libflash/libffs.o
OBJS += objects/pflash/arm_io.o
LIBS=/gsa/ausgsa/home/n/j/njames/openbmc
+OFLAGS =-L$(HOME)/lib -lopenbmc_intf
HOME = /media/sf_vbox/openbmc
CFLAGS=$(shell pkg-config --libs --cflags gtk+-2.0 glib-2.0)
%.o: interfaces/%.c
- $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/includes $(CFLAGS)
+ $(CC) -c -fPIC -o obj/$@ $< -I$(HOME) -I$(HOME)/includes $(CFLAGS)
%.o: objects/%.c
- $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/includes -I$(HOME)/objects/pflash $(CFLAGS)
+ $(CC) -c -o obj/$@ $< -L$(HOME)/lib -I$(HOME) -I$(HOME)/includes -I$(HOME)/objects/pflash -lfru $(CFLAGS)
%.o: includes/%.c
$(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/includes -I$(HOME)/objects/pflash $(CFLAGS)
@@ -18,39 +19,41 @@
%.o: objects/pflash/%.c
$(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/objects/pflash $(CFLAGS)
-power_control: control.o power_control_obj.o gpio.o
- $(CC) -o bin/$@.exe obj/gpio.o obj/control.o obj/power_control_obj.o $(CFLAGS)
+libopenbmc_intf: openbmc_intf.o
+ $(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(CFLAGS)
-chassis_identify: led.o chassis_identify_obj.o gpio.o
- $(CC) -o bin/$@.exe obj/gpio.o obj/led.o obj/chassis_identify_obj.o $(CFLAGS)
+power_control: power_control_obj.o gpio.o
+ $(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o $(OFLAGS) $(CFLAGS)
-sensor_ambient: sensor.o sensor_threshold.o sensor_temperature_ambient_obj.o
- $(CC) -o bin/$@.exe obj/sensor_threshold.o obj/sensor.o obj/sensor_temperature_ambient_obj.o $(CFLAGS)
+chassis_identify: chassis_identify_obj.o gpio.o
+ $(CC) -o bin/$@.exe obj/gpio.o obj/chassis_identify_obj.o $(OFLAGS) $(CFLAGS)
-button_power: button.o button_power_obj.o gpio.o
- $(CC) -o bin/$@.exe obj/button.o obj/button_power_obj.o $(CFLAGS)
+sensor_ambient: sensor_threshold.o sensor_temperature_ambient_obj.o
+ $(CC) -o bin/$@.exe obj/sensor_threshold.o obj/sensor_temperature_ambient_obj.o $(OFLAGS) $(CFLAGS)
-sensor_host_status: sensor.o sensor_host_status_obj.o
- $(CC) -o bin/$@.exe obj/sensor.o obj/sensor_host_status_obj.o $(CFLAGS)
+button_power: button_power_obj.o gpio.o
+ $(CC) -o bin/$@.exe obj/button_power_obj.o $(OFLAGS) $(CFLAGS)
-sensor_occ: sensor.o sensor_occ_obj.o
- $(CC) -o bin/$@.exe obj/sensor.o obj/sensor_occ_obj.o $(CFLAGS)
+sensor_host_status: sensor_host_status_obj.o
+ $(CC) -o bin/$@.exe obj/sensor_host_status_obj.o $(OFLAGS) $(CFLAGS)
-control_host: control.o control_host_obj.o gpio.o
- $(CC) -o bin/$@.exe obj/gpio.o obj/control.o obj/control_host_obj.o $(CFLAGS)
+control_host: control_host_obj.o gpio.o
+ $(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o $(OFLAGS) $(CFLAGS)
-flash_bios: pflash.o flash.o flash_bios_obj.o
- $(CC) -o bin/$@.exe obj/flash.o obj/flash_bios_obj.o $(OBJS) $(CFLAGS)
+flash_bios: pflash.o flash_bios_obj.o
+ $(CC) -o bin/$@.exe obj/flash_bios_obj.o $(OFLAGS) $(OBJS) $(CFLAGS)
-fan: fru.o fan_generic_obj.o gpio.o
- $(CC) -o bin/$@.exe obj/gpio.o obj/fru.o obj/fan_generic_obj.o $(CFLAGS)
+fan: fan_generic_obj.o gpio.o
+ $(CC) -o bin/$@.exe obj/gpio.o obj/fan_generic_obj.o $(OFLAGS) $(CFLAGS)
-fru_generic: fru.o fru_generic_obj.o
- $(CC) -o bin/$@.exe obj/fru.o obj/fru_generic_obj.o $(CFLAGS)
+host_watchdog: host_watchdog_obj.o
+ $(CC) -o bin/$@.exe obj/host_watchdog_obj.o $(OFLAGS) $(CFLAGS)
-fru_board: fru.o fru_board_obj.o
- $(CC) -o bin/$@.exe obj/fru.o obj/fru_board_obj.o $(CFLAGS)
+control_bmc: control_bmc_obj.o
+ $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(OFLAGS) $(CFLAGS)
+sensor_occ: sensor_occ_obj.o
+ $(CC) -o bin/$@.exe obj/sensor_occ_obj.o $(OFLAGS) $(CFLAGS)
-host_watchdog: watchdog.o host_watchdog_obj.o
- $(CC) -o bin/$@.exe obj/watchdog.o obj/host_watchdog_obj.o $(CFLAGS)
+board_vpd: board_vpd_obj.o
+ $(CC) -o bin/$@.exe obj/board_vpd_obj.o $(OFLAGS) $(CFLAGS)