forked from miguelrcborges/simple-bar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
executable file
·47 lines (33 loc) · 799 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CC = gcc
CXXC = g++
OUTPUT = bin/sbar
WARNINGS = -Wall -Wextra -Wwrite-strings -Wno-unused-result
LINKS = -lX11
CFLAGS = -march=native -O2 -ftree-vectorize -fno-semantic-interposition -fno-plt -pipe -s -flto \
$(LINKS) $(WARNINGS) -D_FORTIFY_SOURCE=1
DEBUG = -g
CSRC = $(wildcard src/*.c)
OBJ = $(patsubst src/%.c, obj/%.o, $(CSRC))
BINDIR = bin
OBJDIR = obj
.PHONY = install uninstall debug build
build : $(BINDIR) $(OBJDIR) $(OUTPUT)
$(BINDIR):
mkdir bin
$(OBJDIR):
mkdir obj
$(OUTPUT): $(OBJ)
$(CC) $^ -o $@ $(CFLAGS)
obj/%.o: src/%.c
$(CC) $^ -c -o $@ $(CFLAGS)
run: $(OUTPUT)
bin/my_bar
debug: $(BINDIR) bin/debug
bin/debug: src/*.c
$(CC) $^ -o $@ $(DEBUG)
clean:
rm bin/* obj/*
install: build
install -D -m755 $(OUTPUT) /usr/bin/sbar
uninstall:
rm -f /usr/bin/sbar