Create basic data structs
This commit is contained in:
parent
c9b25ea88e
commit
8f4d61f820
4 changed files with 137 additions and 0 deletions
49
cixdof/Makefile
Normal file
49
cixdof/Makefile
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
CC=clang
|
||||
DEBUG=yes
|
||||
EXEC=test
|
||||
|
||||
# all c files in this directory
|
||||
SRC = $(wildcard *.c)
|
||||
# otherwise
|
||||
#SRC = $(wildcard src_dir1/*.c) \
|
||||
# $(wildcard src_dir2/*.c)
|
||||
|
||||
# -g for debug
|
||||
# -Wall to get all the possible warnings
|
||||
# -ansi -pendantic to get portable code
|
||||
ifeq ($(DEBUG),yes)
|
||||
CFLAGS=-Wall -Wpedantic -g3 -Wextra -Wconversion -Wshadow -fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
LDFLAGS= -Wall -lm -fsanitize=address,undefined
|
||||
else
|
||||
CFLAGS=-W -Wall -pedantic -std=c23 -O3
|
||||
LDFLAGS= -Wall -lm
|
||||
endif
|
||||
|
||||
###############################################
|
||||
# end of the configuration
|
||||
###############################################
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
obj = $(SRC:.c=.o)
|
||||
dep = $(obj:.o=.d)
|
||||
|
||||
|
||||
$(EXEC): $(obj)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
.PHONY: tests
|
||||
tests: $(EXEC)
|
||||
./test
|
||||
|
||||
-include $(dep)
|
||||
|
||||
%.d: %.c
|
||||
@$(CC) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(obj) $(EXEC) $(dep)
|
||||
Loading…
Add table
Add a link
Reference in a new issue