Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 1 | CXX ?= $(CROSS_COMPILE)gcc |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 2 | |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 3 | FRU_WRITE_AND_PARSER_LIB = libwritefrudata.so |
| 4 | FRU_WRITE_AND_PARSER_OBJS = frup.o writefrudata.o |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 5 | |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 6 | INC_FLAGS += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 --std=gnu++14 |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 7 | LIB_FLAGS += $(shell pkg-config --libs libsystemd) -rdynamic |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 8 | |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 9 | DESTDIR ?= / |
| 10 | SBINDIR ?= /usr/sbin |
| 11 | INCLUDEDIR ?= /usr/include |
| 12 | LIBDIR ?= /usr/lib |
| 13 | |
| 14 | all: $(FRU_WRITE_AND_PARSER_LIB) |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 15 | |
| 16 | %.o: %.c |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 17 | $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAGS) $(IPMID_PATH) -o $@ |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 18 | |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 19 | %.o: %.C |
| 20 | $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAGS) $(IPMID_PATH) -o $@ |
| 21 | |
| 22 | $(FRU_WRITE_AND_PARSER_LIB): $(FRU_WRITE_AND_PARSER_OBJS) |
Hariharasubramanian R | 4447309 | 2015-10-15 08:25:28 -0500 | [diff] [blame] | 23 | $(CXX) $^ -shared $(LDFLAGS) $(LIB_FLAGS) -o $@ |
| 24 | |
| 25 | clean: |
Vishwa | 4be4b7a | 2015-10-31 22:55:50 -0500 | [diff] [blame^] | 26 | rm -f $(FRU_WRITE_AND_PARSER_OBJS) $(FRU_WRITE_AND_PARSER_LIB) |
| 27 | |
| 28 | install: |
| 29 | install -m 0755 -d $(DESTDIR)$(LIBDIR)/host-ipmid |
| 30 | install -m 0755 $(FRU_WRITE_AND_PARSER_LIB) $(DESTDIR)$(LIBDIR)/host-ipmid |