summaryrefslogblamecommitdiff
path: root/Makefile
blob: 878dc3a39450ca8517a4b01933642121d6cd0d37 (plain) (tree)
1
2
3
4
5

       
           
 
            
































                                           
                           


















                           
                       

               
                                  
                              
                                                           






                                              
# TOOLS

#CC = clang

# TOOL FLAGS

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)
	mkdir -pm755 $(HDRDIR)/zap
	mkdir -pm755 $(LIBDIR)
	install -Dm644 zap/include/zap/base.h $(HDRDIR)/zap
	install -Dm755 $(LIB) $(LIBDIR)/$(LIB)

clean:
	rm -fr $(OBJS)

purge: clean
	rm -fr $(LIB)