forked from PassiveLogic/open-telemetry-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (42 loc) · 1.15 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
61
# This Makefile may be used to build our fork of opentelemetry-swift for Linux. You may also use it
# on MacOS if you prefer the approach over Xcode (I do).
uname := $(shell uname)
SWIFTC_FLAGS += --configuration debug -Xswiftc -g
SWIFT := swift
SRCDIR := Sources/libpl
INCDIR := $(SRCDIR)/include
LIBDIR := ./lib
CC := gcc
CFLAGS := -ansi -pedantic -Wall -Werror -g
SRC := $(wildcard $(SRCDIR)/*.c)
OBJ := $(SRC:$(SRCDIR)/%.c=$(LIBDIR)/%.o)
LDFLAGS := -L.
LDLIBS := -l$(...)
.PHONY: all clean ctags etags realclean reset resolve update
$(info Building for: [${uname}])
all: opentelemetry
opentelemetry:
${SWIFT} build $(SWIFTC_FLAGS)
update: resolve
$(SWIFT) package update
resolve:
$(SWIFT) package resolve
ctags:
ctags -R --languages=swift .
etags:
etags -R --languages=swift .
reset:
$(SWIFT) package reset
clean:
$(SWIFT) package clean
@rm -rf lib
# NB: Be careful with the realclean target on MacOS, as it will affect your other local Swift project caching.
ifeq ($(uname), Darwin)
realclean: clean
@rm -rf .build
@rm -rf ~/Library/Caches/org.swift.swiftpm
@rm -rf ~/Library/org.swift.swiftpm
else
realclean: clean
@rm -rf .build
endif