Debian Codegraph @

samples/hello2/Makefile

raw
1 # SPDX-FileCopyrightText: Copyright 2024-2025 Sony Group Corporation
2 # SPDX-License-Identifier: MIT
3
4 CC := gcc
5 GCC_MAJOR_VERSION := $(shell $(CC) -dumpversion)
6 GCC_ARCH := $(shell $(CC) -dumpmachine)
7
8 PREFIX ?= /usr/local
9 GCC_PLUGIN_DIR := $(DESTDIR)/$(PREFIX)/lib/gcc/$(GCC_ARCH)/$(GCC_MAJOR_VERSION)/plugin
10 GCC_PLUGIN_DIR := $(subst //,/,$(GCC_PLUGIN_DIR))
11 ESSTRACORE ?= $(GCC_PLUGIN_DIR)/esstracore.so
12
13 ifdef DEBUG
14 DEBUGFLAG := -fplugin-arg-esstracore-debug=$(DEBUG)
15 endif
16
17 CFLAGS += -fplugin=$(ESSTRACORE) $(DEBUGFLAG) -O2 -Wall
18
19 SOURCES := hello_main.c hello_sub.c
20 TARGET := hello2
21
22 .PHONY: all clean
23
24 all: $(TARGET)
25
26 $(TARGET): $(SOURCES)
27 $(CC) $(CFLAGS) $^ -o $@
28
29 clean:
30 rm -f $(TARGET) *.o *.bak