aboutsummaryrefslogtreecommitdiff
path: root/win32/x86/Makefile
blob: 8e165797817d0c5087d073f573d3904b19aed434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
vpath %.c ../
vpath %.c ../../fmdriver
vpath %.c ../../libopna
vpath %.c ../../fmdsp
vpath %.rc ..
TARGET=fmplayer.exe
ICON=../fmplayer.ico
ICONFILES=../fmplayer.png ../fmplayer32.png
FMDRIVER_OBJS=fmdriver_fmp.o \
              ppz8.o
LIBOPNA_OBJS=opna.o \
             opnatimer.o \
             opnafm.o \
             opnassg.o \
             opnadrum.o \
             opnaadpcm.o
FMDSP_OBJS=fmdsp.o font_rom.o
OBJS=main.o dsoundout.o soundout.o waveout.o uc.o lnf.o winfont.o \
     $(FMDRIVER_OBJS) \
     $(LIBOPNA_OBJS) \
     $(FMDSP_OBJS)
ARCH=i686
PREFIX=$(ARCH)-w64-mingw32-
CC=$(PREFIX)gcc
WINDRES=$(PREFIX)windres
STRIP=$(PREFIX)strip
CFLAGS=-std=c99 -Os -Wall -Wextra -pedantic -I../.. \
       -DUNICODE -D_UNICODE \
       -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 \
       -march=i586
LIBS=-nostdlib -s -Wl,-e_entry@4 \
     -Wl,--subsystem,windows \
     -lgcc -lntdll \
     -luser32 -lkernel32 -lole32 -ldxguid -luuid -lcomdlg32 \
     -lgdi32 -lshlwapi -lwinmm -lshell32

$(TARGET):	$(OBJS)
	@echo "  CCLD     $@"
	@$(CC) -o $@ $(OBJS) $(LIBS)
	@$(STRIP) $@

%.o:	%.c
	@echo "  CC       $@"
	@$(CC) $(CFLAGS) -c $< -o $@

%.o:	%.rc $(ICON)
	@echo "  WINDRES  $@"
	@$(WINDRES) -o $@ -i $<

$(ICON):	$(ICONFILES)
	convert $(ICONFILES) -colors 256 $@

clean:
	rm -f $(TARGET) $(OBJS)