-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 848 Bytes
/
Makefile
File metadata and controls
37 lines (29 loc) · 848 Bytes
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
#
# Copyright (c) OpenIPC https://openipc.org MIT License
#
# Makefile — build rules for the Vectis utilities
#
TARGET := vectis
CLI_TARGET := vectis-cli
CC ?= cc
STRIP ?= strip
# Set DEBUG=1 on the command line to build with debug symbols and no strip:
# make DEBUG=1
DEBUG ?= 0
ifeq ($(DEBUG),1)
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -g -O0
LDFLAGS ?=
else
CFLAGS ?= -std=gnu99 -Wall -Wextra -Wpedantic -Os -ffunction-sections -fdata-sections
LDFLAGS ?= -Wl,--gc-sections
endif
all: $(TARGET) $(CLI_TARGET)
$(TARGET): vectis.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
@if [ "$(DEBUG)" = "0" ]; then $(STRIP) $@; fi
$(CLI_TARGET): vectis-cli.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
@if [ "$(DEBUG)" = "0" ]; then $(STRIP) $@; fi
clean:
rm -f $(TARGET) $(CLI_TARGET)
.PHONY: all clean