xref: /openbmc/skeleton/Makefile (revision 8dd499321fd327cd5af3feb09feb3d033168a821)
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 button_reset control_host host_watchdog board_vpd pcie_slot_present flash_bios flasher pflash hwmons_barreleye
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
42led_controller_new: led_controller_new.o
43	$(CC) -o bin/$@.exe obj/led_controller_new.o $(LDFLAGS) $(LIBS) -lsystemd
44
45button_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)
47
48button_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
52control_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)
54
55flash_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)
57
58host_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)
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
73hwmons_barreleye: hwmons_barreleye.o object_mapper.o libopenbmc_intf
74	$(CC) -o bin/$@.exe obj/hwmons_barreleye.o obj/object_mapper.o  $(LDFLAGS) $(LIBS)
75
76