Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 1 | #CC=gcc |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 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 |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 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 |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 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) -Lbin -lopenbmc_intf |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 9 | |
| 10 | %.o: interfaces/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 11 | $(CC) -c -fPIC -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 12 | |
| 13 | %.o: objects/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 14 | $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES) |
Norman James | ddb9738 | 2015-08-27 21:31:31 -0500 | [diff] [blame] | 15 | |
| 16 | %.o: includes/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 17 | $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 18 | |
| 19 | %.o: objects/pflash/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 20 | $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 21 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 22 | %.o: objects/pflash/libflash/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 23 | $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 24 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 25 | setup: |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 26 | mkdir -p obj |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 27 | |
Norman James | 5e792e3 | 2015-10-07 17:36:17 -0500 | [diff] [blame] | 28 | clean: |
| 29 | rm -rf obj |
| 30 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 31 | libopenbmc_intf: openbmc_intf.o |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 32 | $(CC) -shared -o bin/$@.so obj/openbmc_intf.o $(LDFLAGS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 33 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 34 | power_control: power_control_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 35 | $(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 36 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 37 | led_controller: led_controller.o gpio.o object_mapper.o libopenbmc_intf |
| 38 | $(CC) -o bin/$@.exe obj/gpio.o obj/led_controller.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 39 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 40 | button_power: button_power_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 41 | $(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 42 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 43 | control_host: control_host_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 44 | $(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 45 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 46 | flash_bios: flash_bios_obj.o object_mapper.o libopenbmc_intf |
| 47 | $(CC) -o bin/$@.exe obj/flash_bios_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 48 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 49 | fan: fan_generic_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 50 | $(CC) -o bin/$@.exe obj/gpio.o obj/fan_generic_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 51 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 52 | host_watchdog: host_watchdog_obj.o object_mapper.o libopenbmc_intf |
| 53 | $(CC) -o bin/$@.exe obj/host_watchdog_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 54 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 55 | control_bmc: control_bmc_obj.o libopenbmc_intf |
| 56 | $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 57 | |
Norman James | 42c1be8 | 2015-10-22 14:34:26 -0500 | [diff] [blame] | 58 | control_bmc_barreleye: control_bmc_barreleye.o libopenbmc_intf |
| 59 | $(CC) -o bin/$@.exe obj/control_bmc_barreleye.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 60 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 61 | board_vpd: board_vpd_obj.o libopenbmc_intf |
| 62 | $(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 63 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 64 | pcie_slot_present: pcie_slot_present_obj.o gpio.o libopenbmc_intf |
| 65 | $(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(LDFLAGS) $(LIBS) |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 66 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 67 | flasher: $(OBJS2) flasher_obj.o libopenbmc_intf |
| 68 | $(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 69 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 70 | pflash: $(OBJS2) pflash.o |
| 71 | $(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS) |
Norman James | 1899818 | 2015-10-11 21:54:53 -0500 | [diff] [blame] | 72 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 73 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame^] | 74 | all: setup libopenbmc_intf power_control led_controller button_power control_host fan host_watchdog control_bmc board_vpd pcie_slot_present flash_bios flasher control_bmc_barreleye pflash |