rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | PREFIX = ../install |
| 2 | NAME = modemafectrl |
| 3 | COMPILER = GNU |
| 4 | CROSS = arm-linux- |
| 5 | CROSS_SUP= arm-linux- arm-none-eabi- aarch64-linux- |
| 6 | GCC = $(CROSS)gcc |
| 7 | CC = $(GCC) |
| 8 | CXX = $(CROSS)g++ |
| 9 | OBJDUMP = $(CROSS)objdump |
| 10 | OBJCOPY = $(CROSS)objcopy |
| 11 | AR = $(CROSS)ar |
| 12 | |
| 13 | OFLAGS ?= -g -O0 -fPIC -Wno-missing-braces |
| 14 | |
| 15 | ifeq ($(strip $(CROSS)), arm-linux-) |
| 16 | CFLAGS = -mthumb-interwork |
| 17 | endif |
| 18 | |
| 19 | INIT = syss_init |
| 20 | LDFLAGS = $(BB_LDFLAGS_ADD) -Wl,--hash-style=gnu -L. -L $(ROOT)/lib |
| 21 | LOCAL_PATH = . |
| 22 | |
| 23 | |
| 24 | all: libmodemafectrl.so |
| 25 | |
| 26 | INCLUDE = -Iinclude |
| 27 | |
| 28 | libmodemafectrl.so: pcm_ctrl.o |
| 29 | $(CC) $(OFLAGS) $(INCLUDE) ${LDFLAGS} -lasound -lmtk_audio_mixer_ctrl -shared -o $@ pcm_ctrl.o |
| 30 | |
| 31 | pcm_ctrl.o: include/ |
| 32 | $(CC) $(OFLAGS) $(INCLUDE) ${CFLAGS} -c src/pcm_ctrl.c -o $@ |
| 33 | |
| 34 | install: |
| 35 | mkdir -p ../include |
| 36 | cp -af include/* ../include/ |
| 37 | |
| 38 | mkdir -p $(ROOT)/${base_libdir}/ |
| 39 | cp lib$(NAME).so $(ROOT)/${base_libdir}/ |
| 40 | |
| 41 | clean: |
| 42 | rm -f libmodemafectrl.so |