blob: af537a526b9e6015626eaa7da4e3958845a79d49 (
plain)
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
|
CC = cc
# Release options
CFLAGS = -Wall -Wextra -pedantic -O2
TARGET = build/crbc
# Debug options
DEBUG_CFLAGS = -Wall -Wextra -pedantic -O0 -fsanitize=address,undefined -g
DEBUG_TARGET = debug/crbc
# Source
SRC = src/rbc.c
# Install targets
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
INSTALL_TARGET = crbc
INSTALL_DEBUG_TARGET = $(INSTALL_TARGET)_debug
# Compile all
all:
$(CC) $(CFLAGS) $(SRC) -o $(TARGET)
$(CC) $(DEBUG_CFLAGS) $(SRC) -o $(DEBUG_TARGET)
# Compile release (default when 'make')
release:
$(CC) $(CFLAGS) $(SRC) -o $(TARGET)
# Compile debug
rebug:
$(CC) $(DEBUG_CFLAGS) $(SRC) -o $(DEBUG_TARGET)
# Clean all (release + debug)
clean cleanall:
rm -f $(TARGET)
rm -f $(DEBUG_TARGET)
# Clean release
CleanRelease:
rm -f $(TARGET)
# Clean debug
CleanDebug:
rm -f $(DEBUG_TARGET)
# Install all (release + debug)
Install:
install -Dm755 $(INSTALL_TARGET) $(BINDIR)/crbc
install -Dm755 $(INSTALL_DEBUG_TARGET) $(BINDIR)/crbc
# Install release
InstallRelease:
install -Dm755 $(INSTALL_TARGET) $(BINDIR)/crbc
# Install debug
InstallDebug:
install -Dm755 $(INSTALL_DEBUG_TARGET) $(BINDIR)/crbc
# Uninstall all
Uninstall:
rm -f $(BINDIR)/$(INSTALL_TARGET)
rm -f $(BINDIR)/$(INSTALL_DEBUG_TARGET)
|