summaryrefslogtreecommitdiff
path: root/zap/GNUmakefile
blob: a50f8f6c1abdfd4f61a8ac21021f7dc4c65a6a9f (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 2022 Gabriel Jensen.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

ifneq "$(arch)" "amd64"
$(error invalid architecture)
endif

# TOOLS

#CC = clang
#CC = gcc

# TOOL FLAGS

ASFLAGS :=        \
	-g            \
	-march=native
	
CFLAGS :=          \
	-Ofast         \
	-Wall          \
	-Wextra        \
	-Wpedantic     \
	-fPIC          \
	-ffreestanding \
	-g             \
	-march=native  \
	-std=c90

CPPFLAGS :=           \
	-Iinclude         \
	-Iinclude-private \

# ARTEFACTS

OBJS =                              \
	source/$(arch)/mem/fndbyte.o    \
	source/$(arch)/mem/fndchr.o     \
	source/$(arch)/mem/foreach.o    \
	source/$(arch)/mem/memcat.o     \
	source/$(arch)/mem/memcp.o      \
	source/$(arch)/mem/memeq.o      \
	source/$(arch)/mem/memfill.o    \
	source/$(arch)/mem/memgen.o     \
	source/$(arch)/mem/strcat.o     \
	source/$(arch)/mem/streq.o      \
	source/$(arch)/mem/strfill.o    \
	source/$(arch)/mem/strcp.o      \
	source/$(arch)/mem/strlen.o     \
	source/$(arch)/mem/utf8dec.o    \
	source/$(arch)/mem/utf8declen.o \
	source/$(arch)/mem/utf8enc.o    \
	source/$(arch)/mem/utf8enclen.o \
	source/$(arch)/mem/win1252dec.o \
	source/$(arch)/mem/win1252enc.o

LIB = libzap.a

# OPTIONS

# TARGETS

.PHONY: clean install purge

$(LIB): $(OBJS)
	$(AR) r $@ $^

install: $(LIB)
	mkdir -pm755 "$(HDRDIR)/zap"
	mkdir -pm755 "$(LIBDIR)"
	install -m644 "include/zap/"*".h" "$(HDRDIR)/zap"
	install -m755 "$(LIB)" "$(LIBDIR)"

clean:
	$(RM) $(OBJS)

purge: clean
	$(RM) $(LIB)