hualing chen | 7c8ff2e | 2021-08-12 15:39:37 +0800 | [diff] [blame] | 1 | OUTPUT_FILES := libamdvr.so am_fend_test am_dmx_test am_smc_test dvr_wrapper_test |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 2 | |
| 3 | CFLAGS := -Wall -O2 -fPIC -Iinclude |
| 4 | LDFLAGS := -L$(TARGET_DIR)/usr/lib -lmediahal_tsplayer -laudio_client -llog -lpthread -ldl |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 5 | OUT_DIR ?= . |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 6 | |
| 7 | LIBAMDVR_SRCS := \ |
| 8 | src/dvb_dmx_wrapper.c\ |
| 9 | src/dvb_utils.c\ |
| 10 | src/dvr_record.c\ |
| 11 | src/dvr_utils.c\ |
| 12 | src/index_file.c\ |
| 13 | src/record_device.c\ |
| 14 | src/dvb_frontend_wrapper.c\ |
| 15 | src/dvr_playback.c\ |
| 16 | src/dvr_segment.c\ |
| 17 | src/dvr_wrapper.c\ |
| 18 | src/list_file.c\ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 19 | src/segment.c\ |
Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame] | 20 | src/segment_dataout.c\ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 21 | src/am_crypt.c\ |
Zhiqiang Han | a67a825 | 2023-02-25 18:23:48 +0800 | [diff] [blame] | 22 | src/dvr_mutex.c |
Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame] | 23 | |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 24 | LIBAMDVR_OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(LIBAMDVR_SRCS)) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 25 | |
| 26 | AM_FEND_TEST_SRCS := \ |
| 27 | test/am_fend_test/am_fend_test.c |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 28 | AM_FEND_TEST_OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(AM_FEND_TEST_SRCS)) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 29 | |
| 30 | AM_DMX_TEST_SRCS := \ |
| 31 | test/am_dmx_test/am_dmx_test.c |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 32 | AM_DMX_TEST_OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(AM_DMX_TEST_SRCS)) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 33 | |
hualing chen | 7c8ff2e | 2021-08-12 15:39:37 +0800 | [diff] [blame] | 34 | AM_SMC_TEST_SRCS := \ |
| 35 | test/am_smc_test/am_sc2_smc_test.c \ |
| 36 | test/am_smc_test/am_smc.c \ |
| 37 | test/am_smc_test/aml.c \ |
| 38 | test/am_smc_test/am_time.c \ |
| 39 | test/am_smc_test/am_evt.c \ |
| 40 | test/am_smc_test/am_thread.c |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 41 | AM_SMC_TEST_OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(AM_SMC_TEST_SRCS)) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 42 | |
| 43 | DVR_WRAPPER_TEST_SRCS := \ |
| 44 | test/dvr_wrapper_test/dvr_wrapper_test.c |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 45 | DVR_WRAPPER_TEST_OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(DVR_WRAPPER_TEST_SRCS)) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 46 | |
| 47 | |
| 48 | all: $(OUTPUT_FILES) |
| 49 | |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 50 | $(OUT_DIR)/%.o: %.c |
| 51 | mkdir -p $(dir $@) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 52 | $(CC) -c -o $@ $< $(CFLAGS) |
| 53 | |
| 54 | libamdvr.so: $(LIBAMDVR_OBJS) |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 55 | $(CC) -shared -o $(OUT_DIR)/$@ $^ $(LDFLAGS) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 56 | |
| 57 | am_fend_test: $(AM_FEND_TEST_OBJS) libamdvr.so |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 58 | $(CC) -o $(OUT_DIR)/$@ $(AM_FEND_TEST_OBJS) -L$(OUT_DIR) -lamdvr $(LDFLAGS) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 59 | |
| 60 | am_dmx_test: $(AM_DMX_TEST_OBJS) libamdvr.so |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 61 | $(CC) -o $(OUT_DIR)/$@ $(AM_DMX_TEST_OBJS) -L$(OUT_DIR) -lamdvr $(LDFLAGS) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 62 | |
hualing chen | 7c8ff2e | 2021-08-12 15:39:37 +0800 | [diff] [blame] | 63 | am_smc_test: $(AM_SMC_TEST_OBJS) libamdvr.so |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 64 | $(CC) -o $(OUT_DIR)/$@ $(AM_SMC_TEST_OBJS) -L$(OUT_DIR) -lamdvr $(LDFLAGS) |
hualing chen | 7c8ff2e | 2021-08-12 15:39:37 +0800 | [diff] [blame] | 65 | |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 66 | dvr_wrapper_test: $(DVR_WRAPPER_TEST_OBJS) libamdvr.so |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 67 | $(CC) -o $(OUT_DIR)/$@ $(DVR_WRAPPER_TEST_OBJS) -L$(OUT_DIR) -lamdvr $(LDFLAGS) |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 68 | |
| 69 | install: $(OUTPUT_FILES) |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 70 | # install folders |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 71 | install -d -m 0755 $(STAGING_DIR)/usr/include/libdvr |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 72 | install -d -m 0755 $(TARGET_DIR)/usr/include/libdvr |
| 73 | install -d $(TARGET_DIR)/usr/lib |
| 74 | install -d $(TARGET_DIR)/usr/bin |
| 75 | # install so |
| 76 | install -m 0755 $(OUT_DIR)/libamdvr.so $(STAGING_DIR)/usr/lib |
| 77 | install -m 0755 $(OUT_DIR)/libamdvr.so $(TARGET_DIR)/usr/lib |
| 78 | # install test |
| 79 | install -m 0755 $(OUT_DIR)/am_fend_test $(STAGING_DIR)/usr/bin |
| 80 | install -m 0755 $(OUT_DIR)/am_fend_test $(TARGET_DIR)/usr/bin |
| 81 | install -m 0755 $(OUT_DIR)/am_dmx_test $(STAGING_DIR)/usr/bin |
| 82 | install -m 0755 $(OUT_DIR)/am_dmx_test $(TARGET_DIR)/usr/bin |
| 83 | install -m 0755 $(OUT_DIR)/am_smc_test $(STAGING_DIR)/usr/bin |
| 84 | install -m 0755 $(OUT_DIR)/am_smc_test $(TARGET_DIR)/usr/bin |
| 85 | install -m 0755 $(OUT_DIR)/dvr_wrapper_test $(STAGING_DIR)/usr/bin |
| 86 | install -m 0755 $(OUT_DIR)/dvr_wrapper_test $(TARGET_DIR)/usr/bin |
| 87 | # install headers |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 88 | install -m 0644 ./include/* $(STAGING_DIR)/usr/include/libdvr |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 89 | install -m 0644 ./include/* $(TARGET_DIR)/usr/include/libdvr |
| 90 | install -m 0644 ./include/dvb_*.h $(TARGET_DIR)/usr/include |
| 91 | install -m 0644 ./include/dvr_*.h $(TARGET_DIR)/usr/include |
| 92 | install -m 0644 ./include/segment.h $(TARGET_DIR)/usr/include |
| 93 | install -m 0644 ./include/segment_ops.h $(TARGET_DIR)/usr/include |
| 94 | install -m 0644 ./include/list.h $(TARGET_DIR)/usr/include |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 95 | |
| 96 | clean: |
Wentao MA | b3a591c | 2024-01-02 16:19:08 +0800 | [diff] [blame^] | 97 | find $(OUT_DIR) -name \*.o -exec rm -f {} \; |
Gong Ke | 2a0ebbe | 2021-05-25 15:22:50 +0800 | [diff] [blame] | 98 | |
| 99 | .PHONY: all install clean |