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 | 78b7cfb | 2016-01-31 23:29:36 -0600 | [diff] [blame^] | 25 | 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 |
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 | |
vishwa | 7154ed9 | 2016-01-22 06:01:35 -0600 | [diff] [blame] | 42 | led_controller_new: led_controller_new.o |
| 43 | $(CC) -o bin/$@.exe obj/led_controller_new.o $(LDFLAGS) $(LIBS) -lsystemd |
| 44 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 45 | button_power: button_power_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 46 | $(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] | 47 | |
Ken | c95eccd | 2015-12-19 07:02:34 +0800 | [diff] [blame] | 48 | button_reset: button_reset_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 49 | $(CC) -o bin/$@.exe obj/button_reset_obj.o obj/gpio.o obj/object_mapper.o $(LDFLAGS) $(LIBS) |
| 50 | |
| 51 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 52 | control_host: control_host_obj.o gpio.o object_mapper.o libopenbmc_intf |
| 53 | $(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] | 54 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 55 | flash_bios: flash_bios_obj.o object_mapper.o libopenbmc_intf |
| 56 | $(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] | 57 | |
Norman James | 3747822 | 2015-10-31 17:26:01 -0500 | [diff] [blame] | 58 | host_watchdog: host_watchdog_obj.o object_mapper.o libopenbmc_intf |
| 59 | $(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] | 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 | b2acbc8 | 2015-11-06 02:23:04 -0600 | [diff] [blame] | 73 | hwmons_barreleye: hwmons_barreleye.o object_mapper.o libopenbmc_intf |
| 74 | $(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] | 75 | |
Norman James | 78b7cfb | 2016-01-31 23:29:36 -0600 | [diff] [blame^] | 76 | control_bmc: control_bmc_obj.o libopenbmc_intf |
| 77 | $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS) |
| 78 | |