blob: 940e993001fc86b7dfbb18d2f8e171cadd3e8d03 (
plain) (
tree)
|
|
# 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 \
-gdwarf-2 \
-march=native \
-std=c90
CPPFLAGS := \
-Iinclude \
-Iinclude-private \
# ARTEFACTS
OBJS = \
source/$(arch)/mem/memcnt.o \
source/$(arch)/mem/memcp.o \
source/$(arch)/mem/memeq.o \
source/$(arch)/mem/memfill.o \
source/$(arch)/mem/memfnd.o \
source/$(arch)/mem/memfor.o \
source/$(arch)/mem/memgen.o \
source/$(arch)/mem/streq.o \
source/$(arch)/mem/strfill.o \
source/$(arch)/mem/strfnd.o \
source/$(arch)/mem/strcp.o \
source/$(arch)/mem/strlen.o \
source/$(arch)/mem/utf20len.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 \
source/$(arch)/mth/abs.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)
|