xref: /openbmc/skeleton/Makefile (revision 3747822c)
1#CC=gcc
2OBJS    = 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
5OBJS2   = 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
7INCLUDES=$(shell pkg-config --cflags gio-unix-2.0 glib-2.0) -Iincludes -Iobjects/pflash -I.
8LIBS=$(shell pkg-config --libs gio-unix-2.0 glib-2.0) -Lbin -lopenbmc_intf
9
10%.o: interfaces/%.c
11	$(CC) -c -fPIC -o obj/$@ $< $(CFLAGS) $(INCLUDES)
12
13%.o: objects/%.c
14	$(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
15
16%.o: includes/%.c
17	$(CC) -c -o obj/$@ $< $(LIBS) $(CFLAGS) $(INCLUDES)
18
19%.o: objects/pflash/%.c
20	$(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
21
22%.o: objects/pflash/libflash/%.c
23	$(CC) -c -o obj/$@ $< $(CFLAGS) $(INCLUDES)
24
25setup:
26	mkdir -p obj
27
28clean:
29	rm -rf obj
30
31libopenbmc_intf: openbmc_intf.o
32	$(CC) -shared -o bin/$@.so obj/openbmc_intf.o $(LDFLAGS)
33
34power_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)
36
37led_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)
39
40button_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)
42
43control_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)
45
46flash_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)
48
49fan: 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)
51
52host_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)
54
55control_bmc: control_bmc_obj.o libopenbmc_intf
56	$(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS)
57
58control_bmc_barreleye: control_bmc_barreleye.o libopenbmc_intf
59	$(CC) -o bin/$@.exe obj/control_bmc_barreleye.o $(LDFLAGS) $(LIBS)
60
61board_vpd: board_vpd_obj.o libopenbmc_intf
62	$(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS)
63
64pcie_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)
66
67flasher:  $(OBJS2) flasher_obj.o libopenbmc_intf
68	$(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS)
69
70pflash:  $(OBJS2) pflash.o
71	$(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS)
72
73
74all: 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
75