blob: b303513d2cf191738d34afab2b519a18f9bc7406 [file] [log] [blame]
Norman James88872672015-09-21 16:51:35 -05001#CC=gcc
Norman Jamese2765102015-08-19 22:00:55 -05002OBJS = objects/pflash/progress.o objects/pflash/ast-sf-ctrl.o
3OBJS += objects/pflash/libflash/libflash.o objects/pflash/libflash/libffs.o
4OBJS += objects/pflash/arm_io.o
Norman Jamesf066e872015-10-07 15:29:51 -05005OBJS2 = progress.o ast-sf-ctrl.o libflash.o libffs.o arm_io.o
6OBJS3 = obj/progress.o obj/ast-sf-ctrl.o obj/libflash.o obj/libffs.o obj/arm_io.o
Norman James88872672015-09-21 16:51:35 -05007LIBS = ./bin
8OFLAGS =-L$(LIBS) -lopenbmc_intf
9HOME = .
10CFLAGS=$(shell pkg-config --libs --cflags gio-unix-2.0 glib-2.0)
11#CFLAGS = -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgio-2.0 -lgobject-2.0 -lglib-2.0
Norman Jamese2765102015-08-19 22:00:55 -050012
13%.o: interfaces/%.c
Norman James362a80f2015-09-14 14:04:39 -050014 $(CC) -c -fPIC -o obj/$@ $< -I$(HOME) -I$(HOME)/includes $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050015
16%.o: objects/%.c
Norman James88872672015-09-21 16:51:35 -050017 $(CC) -c -o obj/$@ $< -L$(LIBS) -I$(HOME) -I$(HOME)/includes -I$(HOME)/objects/pflash $(CFLAGS)
Norman Jamesddb97382015-08-27 21:31:31 -050018
19%.o: includes/%.c
Norman James88872672015-09-21 16:51:35 -050020 $(CC) -c -o obj/$@ $< -L$(LIBS) -I$(HOME) -I$(HOME)/includes -I$(HOME)/objects/pflash $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050021
22%.o: objects/pflash/%.c
Norman Jamesf066e872015-10-07 15:29:51 -050023 $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/objects/pflash $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050024
Norman Jamesf066e872015-10-07 15:29:51 -050025%.o: objects/pflash/libflash/%.c
26 $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/objects/pflash $(CFLAGS)
Norman James1e25d1d2015-09-15 08:20:56 -050027
Norman Jamesf066e872015-10-07 15:29:51 -050028setup:
29 mkdir obj
Norman James1e25d1d2015-09-15 08:20:56 -050030
Norman James5e792e32015-10-07 17:36:17 -050031clean:
32 rm -rf obj
33
Norman James362a80f2015-09-14 14:04:39 -050034libopenbmc_intf: openbmc_intf.o
Norman James88872672015-09-21 16:51:35 -050035 $(CC) -shared -o bin/$@.so obj/openbmc_intf.o $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050036
Norman James8abb50c2015-09-16 10:58:16 -050037power_control: power_control_obj.o gpio.o
38 $(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050039
Norman Jamesa3e47c42015-10-18 14:43:10 -050040led_controller: led_controller.o gpio.o
41 $(CC) -o bin/$@.exe obj/gpio.o obj/led_controller.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050042
Norman James362a80f2015-09-14 14:04:39 -050043sensor_ambient: sensor_threshold.o sensor_temperature_ambient_obj.o
44 $(CC) -o bin/$@.exe obj/sensor_threshold.o obj/sensor_temperature_ambient_obj.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050045
Norman James362a80f2015-09-14 14:04:39 -050046button_power: button_power_obj.o gpio.o
Norman Jamesb161ae22015-10-06 12:33:07 -050047 $(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050048
Norman James362a80f2015-09-14 14:04:39 -050049control_host: control_host_obj.o gpio.o
50 $(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050051
Norman James18998182015-10-11 21:54:53 -050052flash_bios: flash_bios_obj.o
53 $(CC) -o bin/$@.exe obj/flash_bios_obj.o $(OFLAGS) $(CFLAGS)
Norman Jamese2765102015-08-19 22:00:55 -050054
Norman James362a80f2015-09-14 14:04:39 -050055fan: fan_generic_obj.o gpio.o
56 $(CC) -o bin/$@.exe obj/gpio.o obj/fan_generic_obj.o $(OFLAGS) $(CFLAGS)
Norman James471ab592015-08-30 22:29:40 -050057
Norman James362a80f2015-09-14 14:04:39 -050058host_watchdog: host_watchdog_obj.o
59 $(CC) -o bin/$@.exe obj/host_watchdog_obj.o $(OFLAGS) $(CFLAGS)
Norman James471ab592015-08-30 22:29:40 -050060
Norman James362a80f2015-09-14 14:04:39 -050061control_bmc: control_bmc_obj.o
62 $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(OFLAGS) $(CFLAGS)
Norman James471ab592015-08-30 22:29:40 -050063
Norman James362a80f2015-09-14 14:04:39 -050064sensor_occ: sensor_occ_obj.o
65 $(CC) -o bin/$@.exe obj/sensor_occ_obj.o $(OFLAGS) $(CFLAGS)
Norman James471ab592015-08-30 22:29:40 -050066
Norman James362a80f2015-09-14 14:04:39 -050067board_vpd: board_vpd_obj.o
68 $(CC) -o bin/$@.exe obj/board_vpd_obj.o $(OFLAGS) $(CFLAGS)
Norman James1e25d1d2015-09-15 08:20:56 -050069
Norman James19e45912015-10-04 20:19:41 -050070pcie_slot_present: pcie_slot_present_obj.o gpio.o
71 $(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(OFLAGS) $(CFLAGS)
72
Norman James18998182015-10-11 21:54:53 -050073flasher: $(OBJS2) flasher_obj.o
74 $(CC) -o bin/$@.exe obj/flasher_obj.o $(OFLAGS) $(OBJS3) $(CFLAGS)
Norman James1e25d1d2015-09-15 08:20:56 -050075
Norman Jamesa3e47c42015-10-18 14:43:10 -050076hwmon: hwmon_intf.o
77 $(CC) -o bin/$@.exe obj/hwmon_intf.o $(OFLAGS) $(CFLAGS)
Norman James18998182015-10-11 21:54:53 -050078
Norman Jamesa3e47c42015-10-18 14:43:10 -050079
80all: clean setup libopenbmc_intf power_control led_controller sensor_ambient button_power control_host fan host_watchdog control_bmc board_vpd pcie_slot_present flash_bios flasher