Compare commits
2 commits
a47d3fe0cf
...
e0d5d7e809
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0d5d7e809 | ||
|
|
1be2fa0339 |
2 changed files with 5 additions and 17 deletions
20
Makefile
20
Makefile
|
|
@ -1,12 +1,5 @@
|
||||||
.SILENT:
|
CC ?= gcc
|
||||||
|
CFLAGS := -Wall -Wextra -ggdb
|
||||||
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)
|
SRC := $(wildcard *.c)
|
||||||
OBJ := $(SRC:.c=.o)
|
OBJ := $(SRC:.c=.o)
|
||||||
|
|
@ -25,17 +18,12 @@ SUBDIRS += socket
|
||||||
SUBDIRS += sqlite
|
SUBDIRS += sqlite
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@echo CC $@
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
@$(CC) $(CFLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
%.elf: %.o
|
%.elf: %.o
|
||||||
@echo LD $@
|
$(CC) $(LIBS) -o $@ $<
|
||||||
@$(CC) $(LIBS) -o $@ $<
|
|
||||||
|
|
||||||
all: $(ELF)
|
all: $(ELF)
|
||||||
# @for dir in $(SUBDIRS); do \
|
|
||||||
# $(MAKE) -C $$dir; \
|
|
||||||
# done
|
|
||||||
|
|
||||||
sub:
|
sub:
|
||||||
@-find . -mindepth 1 -maxdepth 1 -type d -exec make --no-print-directory -C {} \;
|
@-find . -mindepth 1 -maxdepth 1 -type d -exec make --no-print-directory -C {} \;
|
||||||
|
|
|
||||||
2
prand.c
2
prand.c
|
|
@ -15,7 +15,7 @@ uint64_t prand() {
|
||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint64_t prand_range(uint64_t min, uint64_t max) {
|
uint64_t prand_range(uint64_t min, uint64_t max) {
|
||||||
uint64_t range = max - min + 1;
|
uint64_t range = max - min + 1;
|
||||||
uint64_t x;
|
uint64_t x;
|
||||||
uint64_t limit = UINT64_MAX - (UINT64_MAX % range);
|
uint64_t limit = UINT64_MAX - (UINT64_MAX % range);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue