diff --git a/Makefile b/Makefile index 5616769..6a7018a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,12 @@ -CC ?= gcc -CFLAGS := -Wall -Wextra -ggdb +.SILENT: + +CC := gcc +CFLAGS := -Wall -Wextra -O2 + +# Silence some errors/warnings for now +CFLAGS += -Wno-implicit-fallthrough +CFLAGS += -Wno-strict-aliasing +CFLAGS += -Wno-uninitialized SRC := $(wildcard *.c) OBJ := $(SRC:.c=.o) @@ -18,12 +25,17 @@ SUBDIRS += socket SUBDIRS += sqlite %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + @echo CC $@ + @$(CC) $(CFLAGS) -c -o $@ $< %.elf: %.o - $(CC) $(LIBS) -o $@ $< + @echo LD $@ + @$(CC) $(LIBS) -o $@ $< all: $(ELF) + # @for dir in $(SUBDIRS); do \ + # $(MAKE) -C $$dir; \ + # done sub: @-find . -mindepth 1 -maxdepth 1 -type d -exec make --no-print-directory -C {} \; diff --git a/prand.c b/prand.c index 58ce137..ba65868 100644 --- a/prand.c +++ b/prand.c @@ -15,7 +15,7 @@ uint64_t prand() { return seed; } -uint64_t prand_range(uint64_t min, uint64_t max) { +inline uint64_t prand_range(uint64_t min, uint64_t max) { uint64_t range = max - min + 1; uint64_t x; uint64_t limit = UINT64_MAX - (UINT64_MAX % range);