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 |
Adriana Kobylak | cc2be26 | 2016-02-09 16:50:14 -0600 | [diff] [blame] | 9 | INCLUDES += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 |
| 10 | LIB_FLAG += $(shell pkg-config --libs libsystemd) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 11 | |
| 12 | %.o: interfaces/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 13 | $(CC) -c -fPIC -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 14 | |
| 15 | %.o: objects/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 16 | $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES) |
Norman James | ddb9738 | 2015-08-27 21:31:31 -0500 | [diff] [blame] | 17 | |
| 18 | %.o: includes/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 19 | $(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 20 | |
| 21 | %.o: objects/pflash/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 22 | $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 23 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 24 | %.o: objects/pflash/libflash/%.c |
Brad Bishop | 831188f | 2015-10-19 14:10:12 -0400 | [diff] [blame] | 25 | $(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES) |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 26 | |
Norman James | 78b7cfb | 2016-01-31 23:29:36 -0600 | [diff] [blame] | 27 | 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] | 28 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 29 | setup: |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 30 | mkdir -p obj lib |
Norman James | 1e25d1d | 2015-09-15 08:20:56 -0500 | [diff] [blame] | 31 | |
Norman James | 5e792e3 | 2015-10-07 17:36:17 -0500 | [diff] [blame] | 32 | clean: |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 33 | rm -rf obj lib bin/*.exe |
Norman James | 5e792e3 | 2015-10-07 17:36:17 -0500 | [diff] [blame] | 34 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 35 | libopenbmc_intf: openbmc_intf.o |
Adriana Kobylak | 597d49e | 2015-10-29 08:33:03 -0500 | [diff] [blame] | 36 | $(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(LDFLAGS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 37 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 38 | power_control: power_control_obj.o gpio.o libopenbmc_intf |
| 39 | $(CC) -o bin/$@.exe obj/gpio.o obj/power_control_obj.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 40 | |
Adriana Kobylak | 9c75104 | 2016-02-09 13:44:32 -0600 | [diff] [blame] | 41 | led_controller: led_controller.o |
Adriana Kobylak | cc2be26 | 2016-02-09 16:50:14 -0600 | [diff] [blame] | 42 | $(CC) -o bin/$@.exe obj/led_controller.o $(LDFLAGS) $(LIB_FLAG) |
vishwa | 7154ed9 | 2016-01-22 06:01:35 -0600 | [diff] [blame] | 43 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 44 | button_power: button_power_obj.o gpio.o libopenbmc_intf |
| 45 | $(CC) -o bin/$@.exe obj/button_power_obj.o obj/gpio.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 46 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 47 | button_reset: button_reset_obj.o gpio.o libopenbmc_intf |
| 48 | $(CC) -o bin/$@.exe obj/button_reset_obj.o obj/gpio.o $(LDFLAGS) $(LIBS) |
Ken | c95eccd | 2015-12-19 07:02:34 +0800 | [diff] [blame] | 49 | |
| 50 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 51 | control_host: control_host_obj.o gpio.o libopenbmc_intf |
| 52 | $(CC) -o bin/$@.exe obj/gpio.o obj/control_host_obj.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 53 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 54 | flash_bios: flash_bios_obj.o libopenbmc_intf |
| 55 | $(CC) -o bin/$@.exe obj/flash_bios_obj.o $(LDFLAGS) $(LIBS) |
Norman James | e276510 | 2015-08-19 22:00:55 -0500 | [diff] [blame] | 56 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 57 | host_watchdog: host_watchdog_obj.o libopenbmc_intf |
| 58 | $(CC) -o bin/$@.exe obj/host_watchdog_obj.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 | |
Brad Bishop | 58e694d | 2016-04-13 16:04:32 -0400 | [diff] [blame] | 72 | hwmons_barreleye: hwmons_barreleye.o libopenbmc_intf |
| 73 | $(CC) -o bin/$@.exe obj/hwmons_barreleye.o $(LDFLAGS) $(LIBS) |
Norman James | 5236a8f | 2015-11-05 20:39:31 -0600 | [diff] [blame] | 74 | |
Norman James | 78b7cfb | 2016-01-31 23:29:36 -0600 | [diff] [blame] | 75 | control_bmc: control_bmc_obj.o libopenbmc_intf |
| 76 | $(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS) |
| 77 | |