mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2025-12-08 20:13:27 +00:00
62 lines
2.2 KiB
Makefile
62 lines
2.2 KiB
Makefile
IMAGECON=./out/imagecon
|
|
OBJS=out/imagecon.o out/png.o
|
|
HOST_WARNINGS=-pedantic-errors -Wfatal-errors -Wall -Werror -Wextra -Wno-unused-parameter -Wshadow -limagequant
|
|
HOST_CFLAGS=$(HOST_WARNINGS)
|
|
LIBS=-lpng -limagequant
|
|
|
|
# test stuff
|
|
OUTPUT_BASE=out/mission-beach
|
|
REFERENCE_BASE=reference/mission-beach
|
|
TEST_IMAGE=../../assets/mission-beach.png
|
|
TEST_IMAGE2=../../assets/tc.png
|
|
SHARED_BASE=out/shared
|
|
REFERENCE_SHARED_BASE=reference/shared
|
|
REFERENCE_SHARED_PALETTE=$(REFERENCE_SHARED_BASE).pal
|
|
SHARED_PALETTE=$(SHARED_BASE).pal
|
|
USED_PALETTE=$(SHARED_BASE).bin $(SHARED_BASE)-copper-list.s
|
|
|
|
$(IMAGECON): out bin $(OBJS)
|
|
gcc $(OBJS) -o $(IMAGECON) $(LIBS)
|
|
|
|
|
|
out/imagecon.o: imagecon.h
|
|
out/png.o: imagecon.h
|
|
|
|
out/%.o: %.c
|
|
gcc -c $(HOST_CFLAGS) $< -o $@
|
|
|
|
out:
|
|
mkdir out
|
|
|
|
bin:
|
|
mkdir bin
|
|
|
|
$(USED_PALETTE): $(SHARED_PALETTE)
|
|
$(IMAGECON) --input $(TEST_IMAGE),$(TEST_IMAGE2) --output $(SHARED_BASE) --colors 32 --quantize --output-bitplanes --output-copperlist
|
|
|
|
$(SHARED_PALETTE): $(IMAGECON)
|
|
-rm -f $(SHARED_PALETTE)
|
|
$(IMAGECON) --input $(TEST_IMAGE),$(TEST_IMAGE2) --output $(SHARED_BASE) --colors 32 --quantize --output-palette
|
|
|
|
$(OUTPUT_BASE).bin: $(IMAGECON)
|
|
-rm -f $(OUTPUT_BASE).bin $(OUTPUT_BASE)-copper-list.s $(OUTPUT_BASE)-palette.s $(OUTPUT_BASE)-mask.bin
|
|
$(IMAGECON) --input $(TEST_IMAGE) --output $(OUTPUT_BASE) --output-mask --output-copperlist --output-bitplanes --output-palette-asm --colors 32 --quantize
|
|
|
|
test: $(IMAGECON) $(OUTPUT_BASE).bin $(SHARED_PALETTE) $(USED_PALETTE)
|
|
diff $(OUTPUT_BASE).bin $(REFERENCE_BASE).bin
|
|
diff $(OUTPUT_BASE)-copper-list.s $(REFERENCE_BASE)-copper-list.s
|
|
diff $(OUTPUT_BASE)-palette.s $(REFERENCE_BASE)-palette.s
|
|
diff $(OUTPUT_BASE)-mask.bin $(REFERENCE_BASE)-mask.bin
|
|
diff $(SHARED_PALETTE) $(REFERENCE_SHARED_PALETTE)
|
|
diff $(SHARED_BASE).bin $(REFERENCE_SHARED_BASE).bin
|
|
diff $(SHARED_BASE)-copper-list.s $(REFERENCE_SHARED_BASE)-copper-list.s
|
|
|
|
@echo "______ ___ _____ _____ ___________ "
|
|
@echo "| ___ \/ _ \ / ___/ ___| ___| _ \ "
|
|
@echo "| |_/ / /_\ \\\\\ \`--.\ \`--.| |__ | | | | "
|
|
@echo "| __/| _ | \`--. \\\`--. \ __|| | | | "
|
|
@echo "| | | | | |/\__/ /\__/ / |___| |/ / "
|
|
@echo "\_| \_| |_/\____/\____/\____/|___/ "
|
|
|
|
clean:
|
|
rm -rf out bin *~
|