summaryrefslogtreecommitdiff
path: root/zap/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'zap/GNUmakefile')
-rw-r--r--zap/GNUmakefile70
1 files changed, 39 insertions, 31 deletions
diff --git a/zap/GNUmakefile b/zap/GNUmakefile
index 58a85ce..442cb32 100644
--- a/zap/GNUmakefile
+++ b/zap/GNUmakefile
@@ -2,6 +2,10 @@
# 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
@@ -9,49 +13,47 @@
# TOOL FLAGS
-ASFLAGS += \
+ASFLAGS := \
-g \
-march=native
-CFLAGS += \
+CFLAGS := \
-Ofast \
+ -Wall \
+ -Wextra \
+ -Wpedantic \
-fPIC \
-ffreestanding \
-g \
-march=native \
- -std=c90 \
- -Wall \
- -Wextra \
- -Wpedantic
+ -std=c90
-CPPFLAGS += \
+CPPFLAGS := \
-Iinclude \
- -Iinclude-private
+ -Iinclude-private \
# ARTEFACTS
-OBJS = \
- src/mem/fndbyte.o \
- src/mem/fndchr.o \
- src/mem/foreach.o \
- src/mem/memcat.o \
- src/mem/memcmp.o \
- src/mem/memcp.o \
- src/mem/memeq.o \
- src/mem/memfill.o \
- src/mem/memgen.o \
- src/mem/strcat.o \
- src/mem/strcmp.o \
- src/mem/streq.o \
- src/mem/strfill.o \
- src/mem/strcp.o \
- src/mem/strlen.o \
- src/mem/utf8dec.o \
- src/mem/utf8declen.o \
- src/mem/utf8enc.o \
- src/mem/utf8enclen.o \
- src/mem/win1252dec.o \
- src/mem/win1252enc.o
+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
@@ -59,11 +61,17 @@ LIB = libzap.a
# TARGETS
-.PHONY: clean purge
+.PHONY: clean install purge
$(LIB): $(OBJS)
$(AR) r $@ $^
+install: $(LIB)
+ mkdir -pm755 "$(HDRDIR)/zap"
+ mkdir -pm755 "$(LIBDIR)"
+ install -m644 "zap/include/zap/"*".h" "$(HDRDIR)/zap"
+ install -m755 "$(LIB)" "$(LIBDIR)"
+
clean:
$(RM) $(OBJS)