GCC_PLUGIN_DIR := $(shell gcc -print-file-name=plugin)
ifeq ($(GCC_PLUGIN_DIR),)
$(error Failed to discover GCC plugin directory)
endif
NAME := $(notdir $(abspath .))
CXX := g++
CXX_FLAGS := -std=c++11 -fno-rtti -fPIC -O3 -I$(GCC_PLUGIN_DIR)/include
LD_FLAGS := -shared -Wl,--version-script,version.map
SRC := $(wildcard *.cpp)
OBJ := $(SRC:.cpp=.o)
$(NAME).so $(OBJ): Makefile
$(NAME).so: $(OBJ) version.map
$(CXX) $(LD_FLAGS) -o $@ $(OBJ)
%.o: %.cpp
$(CXX) $(CXX_FLAGS) -c -o $@ $<
clean:
$(RM) $(OBJ) $(NAME).so
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/gcc-plugins
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/gcc-plugins
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master