-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (22 loc) · 827 Bytes
/
Makefile
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
BIN=brb.a
PREFIX=/usr/local
INC_DIR=./include
CXX=g++
WARNINGS=-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wundef -Werror -Wno-unused
CXXFLAGS=-g -static --entry=__brb_start -Wno-builtin-declaration-mismatch -nostdlib -nostdlib++ -fno-exceptions -I$(INC_DIR) $(WARNINGS)
LDFLAGS=
SRC_FILES := $(wildcard ./src/*.cpp)
all: $(BIN)
$(BIN): ./*.o
ar rvs $@ $^
%.o: ./src/%.cpp
$(CXX) $(CXXFLAGS) -c $(LDFLAGS) $^
install:
cp ./$(BIN) $(DESTDIR)$(PREFIX)/lib/
cp -r $(INC_DIR) $(DESTDIR)$(PREFIX)/include/brb
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
rm -rf $(DESTDIR)$(PREFIX)/include/brb
clean:
rm -f ./$(BIN) *.o
.PHONY: clean