gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-support/png2asset/Makefile
1 # *****************************************************
2 # Variables to control Makefile operation
3
4 # Might want when doing linux -> win cross build
5 # LFLAGS = -s -static
6
7 CXX = $(TOOLSPREFIX)g++
8 CXXFLAGS = -Os -Wall -g # -Wextra -pedantic
9 LFLAGS = -g
10
11 ifeq ($(OS),Windows_NT)
12 BUILD_OS := Windows_NT
13 # Hopefully temporary fix for Windows build linker errors (2026-05-30)
14 # Ref: https://github.com/PurpleI2P/i2pd/issues/2385
15 CXXFLAGS += -std=c++17
16 else
17 BUILD_OS := $(shell uname -s)
18 endif
19
20 # Target older macOS version than whatever build OS is for better compatibility
21 ifeq ($(BUILD_OS),Darwin)
22 export MACOSX_DEPLOYMENT_TARGET=10.10
23 endif
24
25
26 # Static flag for windows cross and native builds
27 ifeq ($(TOOLSPREFIX),i686-w64-mingw32-)
28 # prefix will automatically be .exe for cross build
29 EXT = .exe
30 LFLAGS += -static
31 endif
32
33 ifeq ($(OS),Windows_NT)
34 EXT = .exe
35 LFLAGS += -static
36 endif
37
38
39
40
41 # ****************************************************
42 # Targets needed to bring the executable up to date
43
44 TARGET = png2asset
45
46
47 SRCS := cmp_int_color.cpp image_data.cpp lodepng.cpp map_attributes.cpp \
48 metasprites.cpp png2asset.cpp \
49 rgb_to_nes_lut.cpp \
50 export.cpp export_h_file.cpp export_c_file.cpp export_binary.cpp \
51 image_utils.cpp main.cpp maps.cpp palettes.cpp process_arguments.cpp tiles.cpp
52 OBJS := $(SRCS:%.cpp=%.o)
53
54 $(TARGET): $(OBJS)
55 $(CXX) $(LFLAGS) -o $(TARGET) $(OBJS)
56 strip $@$(EXT)
57
58 # The main.o target can be written more simply
59
60 %.cpp.o: %.cpp
61 $(CXX) $(CXXFLAGS) -c $< -o $@
62
63 clean:
64 rm -f *.o
65 rm -f *.exe
66 rm -f TARGET
67
68 test:
69 $(MAKE) -C testing
70
71 test-clean:
72 $(MAKE) -C testing clean
73
74 test-update:
75 $(MAKE) -C testing update
76
77 test-compare:
78 $(MAKE) -C testing compare-output
79
80 test-reset-ref:
81 $(MAKE) -C testing reset-ref
82
83 test-clean-ref:
84 $(MAKE) -C testing clean-ref
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.