Initial commit with basic vec3 equals function

This commit is contained in:
Alex Selimov 2026-10-20 22:48:22 -04:00
commit c171a2ff7a
8 changed files with 139 additions and 0 deletions

49
mathprimitives/Makefile Normal file
View file

@ -0,0 +1,49 @@
CC=gcc
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=-W -Wall -ansi -pedantic -g -std=c23
LDFLAGS= -Wall -lm
else
CFLAGS=-W -Wall -ansi -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)