Files
dca3-game/vendor/pvrtex/Makefile
MastaG a3ce1e4ed5 Build pvrtex using GNU(++) 17 standard
Recent distros feature GCC 15 which defaults to C23.
ATOMIC_VAR_INIT has been removed from the C23 standard.

This causes the following build failure:
mem.c:72:39: fout: implicit declaration of function ‘ATOMIC_VAR_INIT’; did you mean ‘ATOMIC_FLAG_INIT’? [-Wimplicit-function-declaration]
   72 | static atomic_size_t max_alloc_size = ATOMIC_VAR_INIT(INT_MAX);
      |                                       ^~~~~~~~~~~~~~~
      |                                       ATOMIC_FLAG_INIT

Workaround this by telling the compiler to build using GNU 17 instead.
2025-03-30 20:49:27 +02:00

43 lines
1019 B
Makefile

#Uncomment when debugging
#DEBUGBUILD = true
TARGET = pvrtex
OBJS = elbg.o mem.o log.o bprint.o avstring.o lfg.o crc.o md5.o stb_image_impl.o \
stb_image_write_impl.o stb_image_resize_impl.o optparse_impl.o pvr_texture.o \
dither.o tddither.o vqcompress.o mycommon.o file_common.o \
file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o main.o
ifdef $(DEBUGBUILD)
OPTMODE= -Og -pg -g
else
OPTMODE= -O3 -flto
endif
MYFLAGS=-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0
MYCPPFLAGS=$(MYFLAGS) -std=gnu++17
MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign -std=gnu17
.PHONY: all clean
%.o: %.c
gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@
%.o: %.cpp
gcc $(CFLAGS) $(MYCPPFLAGS) $(CXXFLAGS) $(OPTMODE) -c $< -o $@
$(TARGET): $(OBJS)
gcc $(OPTMODE) -o $(TARGET) \
$(OBJS) $(PROGMAIN) -lm -lstdc++
clean:
rm -f $(TARGET) $(OBJS) README
README: readme_unformatted.txt
fmt -s readme_unformatted.txt > README
all: $(TARGET) README