xref: /openbmc/skeleton/Makefile (revision 0536d6e3)
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) -Llib -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
25all: 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
26
27setup:
28	mkdir -p obj lib
29
30clean:
31	rm -rf obj lib bin/*.exe
32
33libopenbmc_intf: openbmc_intf.o
34	$(CC) -shared -o lib/$@.so obj/openbmc_intf.o $(LDFLAGS)
35
36power_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)
38
39led_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)
41
42button_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)
44
45control_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)
47
48flash_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)
50
51fan: fan_generic_obj.o gpio.o object_mapper.o libopenbmc_intf
52	$(CC) -o bin/$@.exe obj/gpio.o obj/fan_generic_obj.o obj/object_mapper.o $(LDFLAGS) $(LIBS)
53
54host_watchdog: host_watchdog_obj.o object_mapper.o libopenbmc_intf
55	$(CC) -o bin/$@.exe obj/host_watchdog_obj.o obj/object_mapper.o  $(LDFLAGS) $(LIBS)
56
57control_bmc: control_bmc_obj.o libopenbmc_intf
58	$(CC) -o bin/$@.exe obj/control_bmc_obj.o $(LDFLAGS) $(LIBS)
59
60control_bmc_barreleye: control_bmc_barreleye.o libopenbmc_intf
61	$(CC) -o bin/$@.exe obj/control_bmc_barreleye.o $(LDFLAGS) $(LIBS)
62
63board_vpd: board_vpd_obj.o libopenbmc_intf
64	$(CC) -o bin/$@.exe obj/board_vpd_obj.o $(LDFLAGS) $(LIBS)
65
66pcie_slot_present: pcie_slot_present_obj.o gpio.o libopenbmc_intf
67	$(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(LDFLAGS) $(LIBS)
68
69flasher:  $(OBJS2) flasher_obj.o libopenbmc_intf
70	$(CC) -o bin/$@.exe obj/flasher_obj.o $(OBJS3) $(LDFLAGS) $(LIBS)
71
72pflash:  $(OBJS2) pflash.o
73	$(CC) -o bin/$@ obj/pflash.o $(OBJS3) $(LDFLAGS)
74
75