diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 66 |
1 files changed, 46 insertions, 20 deletions
@@ -1,41 +1,67 @@ -SRCS = \ - rgo/src/fastimpl.c \ - rgo/src/fndbyte.c \ - rgo/src/fndchr.c \ - rgo/src/memcpy.c \ - rgo/src/memdup.c \ - rgo/src/memeq.c \ - rgo/src/memfill.c \ - rgo/src/strdup.c \ - rgo/src/streq.c \ - rgo/src/strfill.c \ - rgo/src/strcpy.c \ - rgo/src/strlen.c - -OBJS := $(SRCS:.c=.o) -LIB := librgo.a +# TOOLS + +# TOOL FLAGS CFLAGS = \ -Irgo/include \ -Irgo/include-priv \ -O3 \ -g \ - -march=native + -march=native \ + -std=c99 \ + -Wall \ + -Wextra \ + -Wpedantic + +# Uncomment to enable freestanding mode: +#CFLAGS += \ + -Drgo_priv_nostdlib \ + -ffreestanding # Uncomment to disable assembly algorithms: #CFLAGS += -Drgo_priv_noasm +# HEADERS + +HDRS = \ + rgo/include-priv/rgo-priv.h \ + rgo/include/rgo.h \ + +# BINARIES + +OBJS = \ + rgo/src/fastimpl.o \ + rgo/src/fndbyte.o \ + rgo/src/fndchr.o \ + rgo/src/memcmp.o \ + rgo/src/memcpy.o \ + rgo/src/memdup.o \ + rgo/src/memeq.o \ + rgo/src/memfill.o \ + rgo/src/strcmp.o \ + rgo/src/strdup.o \ + rgo/src/streq.o \ + rgo/src/strfill.o \ + rgo/src/strcpy.o \ + rgo/src/strlen.o + +LIB = librgo.a + +# TARGETS + .PHONY: clean install purge $(LIB): $(OBJS) ar r $@ $^ install: $(LIB) - install -Dm644 rgo/include/rgo.h $(HDRDIR)/rgo.h + mkdir -pm755 $(HDRDIR) + mkdir -pm755 $(LIBDIR) + install -Dm644 rgo/include/rgo.h $(HDRDIR) install -Dm755 $(LIB) $(LIBDIR)/$(LIB) clean: rm -fr $(OBJS) -purge: - rm -fr $(LIB) $(OBJS) +purge: clean + rm -fr $(LIB) |