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. |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 8 | LIBS=$(shell pkg-config --libs gio-unix-2.0 glib-2.0) -Llib -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 | c741075 | 2015-11-17 08:57:20 -0600 | [diff] [blame^] | 25 | all: setup libopenbmc_intf power_control led_controller button_power control_host host_watchdog control_bmc board_vpd pcie_slot_present flash_bios flasher control_bmc_barreleye pflash hwmons_barreleye |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 26 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 27 | setup: |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 28 | mkdir -p obj lib |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 29 | |
Norman James | 5e792e3 | 2015-10-07 17:36:17 -0500 | [diff] [blame] | 30 | clean: |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 31 | rm -rf obj lib bin/*.exe |
Norman James | 5e792e3 | 2015-10-07 17:36:17 -0500 | [diff] [blame] | 32 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 33 | libopenbmc_intf: openbmc_intf.o |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 34 | $(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(LDFLAGS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 35 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 36 | power_control: power_control_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 37 | $(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] | 38 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 39 | led_controller: led_controller.o gpio.o object_mapper.o libopenbmc_intf |
| 40 | $(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] | 41 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 42 | button_power: button_power_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 43 | $(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] | 44 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 45 | control_host: control_host_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 46 | $(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] | 47 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 48 | flash_bios: flash_bios_obj.o object_mapper.o libopenbmc_intf |
| 49 | $(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] | 50 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 51 | host_watchdog: host_watchdog_obj.o object_mapper.o libopenbmc_intf |
| 52 | $(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] | 53 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 54 | control_bmc: control_bmc_obj.o libopenbmc_intf |
| 55 | $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 56 | |
Norman James | 42c1be8 | 2015-10-22 14:34:26 -0500 | [diff] [blame] | 57 | control_bmc_barreleye: control_bmc_barreleye.o libopenbmc_intf |
| 58 | $(CC) -o bin/$@.exe obj/control_bmc_barreleye.o $(LDFLAGS) $(LIBS) |
Norman James | 471ab59 | 2015-08-30 22:29:40 -0500 | [diff] [blame] | 59 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 60 | board_vpd: board_vpd_obj.o libopenbmc_intf |
| 61 | $(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 62 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 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) |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 65 | |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 66 | flasher: $(OBJS2) flasher_obj.o libopenbmc_intf |
| 67 | $(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 68 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 69 | pflash: $(OBJS2) pflash.o |
| 70 | $(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS) |
Norman James | 1899818 | 2015-10-11 21:54:53 -0500 | [diff] [blame] | 71 | |
Norman James | b2acbc8 | 2015-11-06 02:23:04 -0600 | [diff] [blame] | 72 | hwmons_barreleye: hwmons_barreleye.o object_mapper.o libopenbmc_intf |
| 73 | $(CC) -o bin/$@.exe obj/hwmons_barreleye.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
Norman James | 5236a8f | 2015-11-05 20:39:31 -0600 | [diff] [blame] | 74 | |