rtc: stm32: fix misspelling and misalignment issues
[linux/fpc-iii.git] / tools / bpf / Makefile
blob1ea545965ee36c3a8dca16fd0e34f19aa4894e60
1 # SPDX-License-Identifier: GPL-2.0
2 include ../scripts/Makefile.include
4 prefix ?= /usr/local
6 CC = gcc
7 LEX = flex
8 YACC = bison
9 MAKE = make
10 INSTALL ?= install
12 CFLAGS += -Wall -O2
13 CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi -I$(srctree)/include
15 ifeq ($(srctree),)
16 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
17 srctree := $(patsubst %/,%,$(dir $(srctree)))
18 endif
20 ifeq ($(V),1)
21 Q =
22 else
23 Q = @
24 endif
26 FEATURE_USER = .bpf
27 FEATURE_TESTS = libbfd disassembler-four-args
28 FEATURE_DISPLAY = libbfd disassembler-four-args
30 check_feat := 1
31 NON_CHECK_FEAT_TARGETS := clean bpftool_clean
32 ifdef MAKECMDGOALS
33 ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
34 check_feat := 0
35 endif
36 endif
38 ifeq ($(check_feat),1)
39 ifeq ($(FEATURES_DUMP),)
40 include $(srctree)/tools/build/Makefile.feature
41 else
42 include $(FEATURES_DUMP)
43 endif
44 endif
46 ifeq ($(feature-disassembler-four-args), 1)
47 CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
48 endif
50 $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
51 $(QUIET_BISON)$(YACC) -o $@ -d $<
53 $(OUTPUT)%.lex.c: $(srctree)/tools/bpf/%.l
54 $(QUIET_FLEX)$(LEX) -o $@ $<
56 $(OUTPUT)%.o: $(srctree)/tools/bpf/%.c
57 $(QUIET_CC)$(COMPILE.c) -o $@ $<
59 $(OUTPUT)%.yacc.o: $(OUTPUT)%.yacc.c
60 $(QUIET_CC)$(COMPILE.c) -o $@ $<
61 $(OUTPUT)%.lex.o: $(OUTPUT)%.lex.c
62 $(QUIET_CC)$(COMPILE.c) -o $@ $<
64 PROGS = $(OUTPUT)bpf_jit_disasm $(OUTPUT)bpf_dbg $(OUTPUT)bpf_asm
66 all: $(PROGS) bpftool
68 $(OUTPUT)bpf_jit_disasm: CFLAGS += -DPACKAGE='bpf_jit_disasm'
69 $(OUTPUT)bpf_jit_disasm: $(OUTPUT)bpf_jit_disasm.o
70 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^ -lopcodes -lbfd -ldl
72 $(OUTPUT)bpf_dbg: $(OUTPUT)bpf_dbg.o
73 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^ -lreadline
75 $(OUTPUT)bpf_asm: $(OUTPUT)bpf_asm.o $(OUTPUT)bpf_exp.yacc.o $(OUTPUT)bpf_exp.lex.o
76 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^
78 $(OUTPUT)bpf_exp.lex.c: $(OUTPUT)bpf_exp.yacc.c
80 clean: bpftool_clean
81 $(call QUIET_CLEAN, bpf-progs)
82 $(Q)rm -rf $(OUTPUT)*.o $(OUTPUT)bpf_jit_disasm $(OUTPUT)bpf_dbg \
83 $(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.*
84 $(call QUIET_CLEAN, core-gen)
85 $(Q)rm -f $(OUTPUT)FEATURE-DUMP.bpf
87 install: $(PROGS) bpftool_install
88 $(call QUIET_INSTALL, bpf_jit_disasm)
89 $(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/bin
90 $(Q)$(INSTALL) $(OUTPUT)bpf_jit_disasm $(DESTDIR)$(prefix)/bin/bpf_jit_disasm
91 $(call QUIET_INSTALL, bpf_dbg)
92 $(Q)$(INSTALL) $(OUTPUT)bpf_dbg $(DESTDIR)$(prefix)/bin/bpf_dbg
93 $(call QUIET_INSTALL, bpf_asm)
94 $(Q)$(INSTALL) $(OUTPUT)bpf_asm $(DESTDIR)$(prefix)/bin/bpf_asm
96 bpftool:
97 $(call descend,bpftool)
99 bpftool_install:
100 $(call descend,bpftool,install)
102 bpftool_clean:
103 $(call descend,bpftool,clean)
105 .PHONY: all install clean bpftool bpftool_install bpftool_clean