This commit is contained in:
Mylloon 2023-05-08 11:45:51 +02:00
parent 7d6056a462
commit 2bb1a19e4b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -73,9 +73,9 @@ $(PROGNAME): $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME) $(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME)
debug: CFLAGS := $(filter-out $(COPTI),$(CFLAGS)) -Wextra -Wconversion -g3 -Og \ debug: CFLAGS := $(filter-out $(COPTI),$(CFLAGS)) -Wextra -Wconversion -g3 -Og \
-Wno-sign-conversion -Wno-unused-parameter -Wno-unused-function \ -Wno-sign-conversion -Wno-unused-parameter -Wno-unused-function \
-Wdouble-promotion -Wshadow -Wcast-align -Wstrict-prototypes \ -Wdouble-promotion -Wshadow -Wcast-align -Wstrict-prototypes \
-fanalyzer -fsanitize=undefined -fsanitize-undefined-trap-on-error -fanalyzer -fsanitize=undefined -fsanitize-undefined-trap-on-error
debug: $(PROGNAME) debug: $(PROGNAME)
%.o: %.c %.o: %.c
@ -101,13 +101,14 @@ distdir: $(DISTFILES)
$(CP) $(DISTFILES) $(distdir) $(CP) $(DISTFILES) $(distdir)
doc: $(DOXYFILE) doc: $(DOXYFILE)
cat $< | sed -e "s/PROJECT_NAME *=.*/PROJECT_NAME = $(PROGNAME)/" |\ cat $< | sed -e "s/PROJECT_NAME *=.*/PROJECT_NAME = $(PROGNAME)/" | \
sed -e "s/PROJECT_NUMBER *=.*/PROJECT_NUMBER = $(VERSION)/" >> $<.new sed -e "s/PROJECT_NUMBER *=.*/PROJECT_NUMBER = $(VERSION)/" >> $<.new
mv -f $<.new $< mv -f $<.new $<
cd documentation && doxygen && cd .. cd documentation && doxygen && cd ..
msvc: $(VSCFILES) msvc: $(VSCFILES)
@echo "Now these files ($?) already exist. If you wish to regenerate them, you should first delete them manually." @echo "Now these files ($?) already exist. If you wish to regenerate them, you \
should first delete them manually."
$(VSCFILES): $(VSCFILES):
@echo "Generating $@ ..." @echo "Generating $@ ..."
@ -117,8 +118,8 @@ $(VSCFILES):
sed -e "s/INSERT_SOURCE_FILES/$(MSVCSRC)/" > $@ sed -e "s/INSERT_SOURCE_FILES/$(MSVCSRC)/" > $@
clean: clean:
@$(RM) -r $(PROGNAME) $(OBJ) *~ $(distdir).tgz $(distdir).zip $(distdir)/ \ @$(RM) -r $(PROGNAME) $(OBJ) *~ $(distdir).tgz $(distdir).zip $(distdir)/ \
gmon.out core.* documentation/*~ shaders/*~ documentation/html gmon.out core.* documentation/*~ shaders/*~ documentation/html
distminified: distdirminified dist distminified: distdirminified dist
@ -126,13 +127,15 @@ distminified: distdirminified dist
distdirminified: EXTRAFILES := $(filter-out $(VSCFILES),$(EXTRAFILES)) distdirminified: EXTRAFILES := $(filter-out $(VSCFILES),$(EXTRAFILES))
distdirminified: DISTFILES := $(filter-out $(DOXYFILE),$(DISTFILES)) distdirminified: DISTFILES := $(filter-out $(DOXYFILE),$(DISTFILES))
distdirminified: distdir distdirminified: distdir
@$(CURL) https://raw.githubusercontent.com/BaseMax/C-Minifier/main/Minifier.c | $(CC) -o $(MINIFIER) $(CFLAGS) -x c - @$(CURL) https://raw.githubusercontent.com/BaseMax/C-Minifier/main/Minifier.c | \
$(CC) -o $(MINIFIER) $(CFLAGS) -x c -
$(foreach f,$(SOURCES),./$(MINIFIER) $(f) $(distdir)/$(f);) $(foreach f,$(SOURCES),./$(MINIFIER) $(f) $(distdir)/$(f);)
@$(RM) $(MINIFIER) @$(RM) $(MINIFIER)
size: $(PROGNAME) size: $(PROGNAME)
size: SIZEFILES = $(PROGNAME) $(filter-out $(VSCFILES) COPYING,$(EXTRAFILES)) size: SIZEFILES = $(PROGNAME) $(filter-out $(VSCFILES) COPYING,$(EXTRAFILES))
size: SIZEINFOS = ("; printf $$1; print "Ko - soit `$(shell echo $(SIZEFILES) | sed 's/ /`, `/g')`)" size: SIZEINFOS = ("; printf $$1; print "/$(MAXSIZE)Ko - soit \
`$(shell echo $(SIZEFILES) | sed 's/ /`, `/g')`)"
size: size:
@$(DU) --total $(SIZEFILES) | \ @$(DU) --total $(SIZEFILES) | \
$(TAIL) -n 1 | \ $(TAIL) -n 1 | \