summaryrefslogtreecommitdiff
path: root/Kbuild
blob: 3a5e6b265df905c873981e33ebfac4328108c00c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
EXTRA_CFLAGS := $(extra_cflags)

obj-m := swap.o


swap-y := buffer/swap_buffer_module.o \
          buffer/buffer_queue.o \
          driver/swap_driver_module.o \
          driver/device_driver.o \
          driver/driver_to_buffer.o \
          driver/swap_debugfs.o \
          writer/swap_writer_module.o \
          writer/debugfs_writer.o \
          writer/event_filter.o \
          kprobe/dbi_kprobes_deps.o \
          kprobe/dbi_insn_slots.o \
          kprobe/arch/asm/dbi_kprobes.o \
          kprobe/dbi_kprobes.o \
          uprobe/swap_uprobes.o \
          uprobe/arch/asm/swap_uprobes.o \
          us_manager/us_manager.o \
          us_manager/us_slot_manager.o \
          us_manager/helper.o \
          us_manager/debugfs_us_manager.o \
          us_manager/sspt/ip.o \
          us_manager/sspt/sspt_page.o \
          us_manager/sspt/sspt_file.o \
          us_manager/sspt/sspt_proc.o \
          us_manager/sspt/sspt_feature.o \
          us_manager/pf/proc_filters.o \
          us_manager/pf/pf_group.o \
          us_manager/img/img_proc.o \
          us_manager/img/img_file.o \
          us_manager/img/img_ip.o \
          ks_features/ks_features.o \
          sampler/swap_sampler_module.o \
          energy/energy_module.o \
          energy/energy.o \
          energy/rational_debugfs.o \
          energy/debugfs_energy.o \
          energy/lcd/lcd_base.o \
          energy/lcd/lcd_debugfs.o \
          parser/swap_msg_parser.o \
          parser/msg_parser.o \
          parser/msg_buf.o \
          parser/msg_cmd.o \
          parser/features.o \
          parser/us_inst.o \
          dlog_suspend/swap_dlog_suspend.o \
          dlog_suspend/elf_parser.o \
          dlog_suspend/file_ops.o \
          dlog_suspend/get_task.o \
          dlog_suspend/tasks_list.o \
          dlog_suspend/dentry.o \
          dlog_suspend/lib_handler.o \
          swap_module.o

ifeq ($(CONFIG_KALLSYMS),y)
	swap-y += ksyms/ksyms.o
else
	swap-y += ksyms/no_ksyms.o
endif

ifeq ($(CONFIG_CONNECTOR),y)
	swap-y += driver/us_interaction.o
endif

swap-$(CONFIG_ARM) += writer/kernel_operations_arm.o
swap-$(CONFIG_X86) += writer/kernel_operations_x86.o

swap-$(CONFIG_ARM) += kprobe/arch/asm/trampoline_arm.o

swap-$(CONFIG_ARM) += uprobe/arch/asm/trampoline_thumb.o

ifdef CONFIG_HIGH_RES_TIMERS
    swap-y += sampler/sampler_hrtimer.o
else
    swap-y += sampler/sampler_timer.o
endif

###############################################################################
###                               math support                              ###
###############################################################################
# S6E8AA0:
ifeq ($(CONFIG_LCD_S6E8AA0), y)
    swap-y += energy/lcd/s6e8aa0.o
    LCD_FUNC_LIST += s6e8aa0
endif


# PANEL_S6E8AA0:
ifeq ($(CONFIG_DISPLAY_PANEL_S6E8AA0), y)
    swap-y += energy/lcd/s6e8aa0_panel.o
    LCD_FUNC_LIST += s6e8aa0_panel
endif


# MARU:
ifeq ($(CONFIG_MARU_BACKLIGHT), y)
    swap-y += energy/lcd/maru.o
    LCD_FUNC_LIST += maru
endif





###############################################################################
###                          description functions                          ###
###############################################################################
LCD_FUNC_ARGS := void
LCD_FUNC_RET := struct lcd_ops *





###############################################################################
###                            generate defines                             ###
###############################################################################
LCD_PREFIX := lcd_energy_

# add prefix
TMP := $(foreach it, $(LCD_FUNC_LIST), $(LCD_PREFIX)$(it))
LCD_FUNC_LIST := $(TMP)

# generate DEFINITION_LCD_FUNC
TMP := ($(LCD_FUNC_ARGS));
DEFINITION_LCD_FUNC := DEFINITION_LCD_FUNC=\
$(foreach it, $(LCD_FUNC_LIST), "extern" $(LCD_FUNC_RET) $(it)$(TMP))


# generate DEFINITION_LCD_ARRAY
COMMA := ,
AND := &
DEFINITION_LCD_ARRAY := DEFINITION_LCD_ARRAY=\
"{" $(foreach it, $(LCD_FUNC_LIST), &$(it),) "}"


# generate LCD_MAKE_FNAME
LCD_MAKE_FNAME := LCD_MAKE_FNAME(name)=$(LCD_PREFIX)\#\#name





###############################################################################
###                  add generate defines to EXTRA_CFLAGS                   ###
###############################################################################
EXTRA_CFLAGS += -D"$(DEFINITION_LCD_FUNC)" \
                -D"$(DEFINITION_LCD_ARRAY)" \
                -D"$(LCD_MAKE_FNAME)"