Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 1 | CXX ?= $(CROSS_COMPILE)g++ |
| 2 | |
Chris Austen | f79a21f | 2015-10-13 14:41:40 -0500 | [diff] [blame] | 3 | TESTER = testit |
| 4 | TESTER_OBJ = testit.o oemhandler.o |
| 5 | |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 6 | LIB_OEM_OBJ = oemhandler.o |
| 7 | LIB_OEM = liboemhandler.so |
| 8 | |
| 9 | LDFLAGS += -rdynamic -ldl |
| 10 | CXXFLAGS += -fPIC -Wall |
| 11 | |
| 12 | |
Chris Austen | f79a21f | 2015-10-13 14:41:40 -0500 | [diff] [blame] | 13 | all: $(TESTER) $(LIB_OEM) |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 14 | |
| 15 | %.o: %.C |
| 16 | $(CXX) -c $< $(CXXFLAGS) -o $@ |
| 17 | |
| 18 | |
| 19 | $(LIB_OEM): $(LIB_OEM_OBJ) |
| 20 | $(CXX) $^ -shared $(LDFLAGS) -o $@ |
| 21 | |
Chris Austen | f79a21f | 2015-10-13 14:41:40 -0500 | [diff] [blame] | 22 | $(TESTER): $(TESTER_OBJ) |
| 23 | $(CXX) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ -ldl |
| 24 | |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 25 | clean: |
Chris Austen | f79a21f | 2015-10-13 14:41:40 -0500 | [diff] [blame] | 26 | $(RM) $(LIB_OEM_OBJ) $(LIB_OEM) $(TESTER_OBJ) $(TESTER) |