summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile73
1 files changed, 11 insertions, 62 deletions
diff --git a/Makefile b/Makefile
index 878dc3a..f4d59b1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,71 +1,20 @@
-# TOOLS
+LIBZAP = zap/libzap.a
-#CC = clang
+.PHONY: clean install purge zap
-# TOOL FLAGS
+zap:
+ $(MAKE) -Czap
-CFLAGS = \
- -Izap/include \
- -Izap/include-priv \
- -O3 \
- -fPIC \
- -g \
- -march=native \
- -std=c99 \
- -Wall \
- -Wextra \
- -Wpedantic
-
-# Uncomment to enable freestanding mode:
-#CFLAGS += \
- -Dzap_priv_nostdlib \
- -ffreestanding
-
-# Uncomment to disable assembly algorithms:
-#CFLAGS += -Dzap_priv_noasm
-
-# HEADERS
-
-HDRS = \
- zap/include-priv/zap/priv.h \
- zap/include/zap.h \
-
-# BINARIES
-
-OBJS = \
- zap/src/fastimpl.o \
- zap/src/fndbyte.o \
- zap/src/fndchr.o \
- zap/src/foreach.o \
- zap/src/memcmp.o \
- zap/src/memcpy.o \
- zap/src/memdup.o \
- zap/src/memeq.o \
- zap/src/memfill.o \
- zap/src/strcmp.o \
- zap/src/strdup.o \
- zap/src/streq.o \
- zap/src/strfill.o \
- zap/src/strcpy.o \
- zap/src/strlen.o
-
-LIB = libzap.a
-
-# TARGETS
-
-.PHONY: clean install purge
-
-$(LIB): $(OBJS)
- ar r $@ $(OBJS)
-
-install: $(LIB)
+install: zap
mkdir -pm755 $(HDRDIR)/zap
mkdir -pm755 $(LIBDIR)
install -Dm644 zap/include/zap/base.h $(HDRDIR)/zap
- install -Dm755 $(LIB) $(LIBDIR)/$(LIB)
+ install -Dm644 zap/include/zap/math.h $(HDRDIR)/zap
+ install -Dm644 zap/include/zap/mem.h $(HDRDIR)/zap
+ install -Dm755 $(LIBZAP) $(LIBDIR)
clean:
- rm -fr $(OBJS)
+ $(MAKE) -Czap clean
-purge: clean
- rm -fr $(LIB)
+purge:
+ $(MAKE) -Czap purge