xref: /openbmc/linux/drivers/video/logo/Makefile (revision b830f94f)
1# SPDX-License-Identifier: GPL-2.0
2# Makefile for the Linux logos
3
4obj-$(CONFIG_LOGO)			+= logo.o
5obj-$(CONFIG_LOGO_LINUX_MONO)		+= logo_linux_mono.o
6obj-$(CONFIG_LOGO_LINUX_VGA16)		+= logo_linux_vga16.o
7obj-$(CONFIG_LOGO_LINUX_CLUT224)	+= logo_linux_clut224.o
8obj-$(CONFIG_LOGO_DEC_CLUT224)		+= logo_dec_clut224.o
9obj-$(CONFIG_LOGO_MAC_CLUT224)		+= logo_mac_clut224.o
10obj-$(CONFIG_LOGO_PARISC_CLUT224)	+= logo_parisc_clut224.o
11obj-$(CONFIG_LOGO_SGI_CLUT224)		+= logo_sgi_clut224.o
12obj-$(CONFIG_LOGO_SUN_CLUT224)		+= logo_sun_clut224.o
13obj-$(CONFIG_LOGO_SUPERH_MONO)		+= logo_superh_mono.o
14obj-$(CONFIG_LOGO_SUPERH_VGA16)		+= logo_superh_vga16.o
15obj-$(CONFIG_LOGO_SUPERH_CLUT224)	+= logo_superh_clut224.o
16
17obj-$(CONFIG_SPU_BASE)			+= logo_spe_clut224.o
18
19# How to generate logo's
20
21# Use logo-cfiles to retrieve list of .c files to be built
22logo-cfiles = $(notdir $(patsubst %.$(2), %.c, \
23              $(wildcard $(srctree)/$(src)/*$(1).$(2))))
24
25
26# Mono logos
27extra-y += $(call logo-cfiles,_mono,pbm)
28
29# VGA16 logos
30extra-y += $(call logo-cfiles,_vga16,ppm)
31
32# 224 Logos
33extra-y += $(call logo-cfiles,_clut224,ppm)
34
35# Gray 256
36extra-y += $(call logo-cfiles,_gray256,pgm)
37
38pnmtologo := scripts/pnmtologo
39
40# Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
41quiet_cmd_logo = LOGO    $@
42	cmd_logo = $(pnmtologo) \
43			-t $(patsubst $*_%,%,$(notdir $(basename $<))) \
44			-n $(notdir $(basename $<)) -o $@ $<
45
46$(obj)/%_mono.c: $(src)/%_mono.pbm $(pnmtologo) FORCE
47	$(call if_changed,logo)
48
49$(obj)/%_vga16.c: $(src)/%_vga16.ppm $(pnmtologo) FORCE
50	$(call if_changed,logo)
51
52$(obj)/%_clut224.c: $(src)/%_clut224.ppm $(pnmtologo) FORCE
53	$(call if_changed,logo)
54
55$(obj)/%_gray256.c: $(src)/%_gray256.pgm $(pnmtologo) FORCE
56	$(call if_changed,logo)
57
58# Files generated that shall be removed upon make clean
59clean-files := *.o *_mono.c *_vga16.c *_clut224.c *_gray256.c
60