-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·61 lines (40 loc) · 1.11 KB
/
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
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
NAME=fillwan
DEPS=
CC=g++
LD=ld
CPPFLAGS= -Wall -std=c++20 -O1
LINKFLAGS= -s
PREFIX=/usr/bin
SOURCEDIR=src
BUILDDIR=obj
TARGETDIR=bin
SOURCES= $(SOURCEDIR)/processing.cpp $(SOURCEDIR)/main.cpp
HEADERS= $(SOURCEDIR)/definitions.hpp $(SOURCEDIR)/words_de.hpp $(SOURCEDIR)/words_en.hpp
OBJECTS= $(BUILDDIR)/processing.o $(BUILDDIR)/main.o
# Building
# ###################################################################
all: build
build: compile link
link: compile
$(CC) -o $(TARGETDIR)/$(NAME) $(LINKFLAGS) $(OBJECTS)
compile: $(OBJECTS)
# currently rebuilds everything if a header has changed
$(OBJECTS): $(BUILDDIR)/%.o : $(SOURCEDIR)/%.cpp $(HEADERS) | makedir
$(CC) $(CPPFLAGS) -c $< -o $@
makedir:
@mkdir -p $(BUILDDIR)
@mkdir -p $(TARGETDIR)
# Misc
# ###################################################################
clean:
rm -f $(OBJECTS)
rm -f $(TARGETDIR)/$(NAME)
install: build
install $(TARGETDIR)/$(NAME) $(PREFIX)/$(NAME)
uninstall:
rm $(PREFIX)/$(NAME)
compress:
strip -s -R .comment $(TARGETDIR)/$(NAME)
upx --lzma -qq $(TARGETDIR)/$(NAME)
decompress:
upx -d -qq $(TARGETDIR)/$(NAME)