aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 41789039c7a8ed3c4ea3a33dba4ab8721e6810bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
PROJECT=sercp
all:	$(PROJECT) $(PROJECT).w32 $(PROJECT).w64

sercp:	$(PROJECT).c
	gcc $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2

sercp.w64: $(PROJECT).c
	rm -f $(PROJECT).res
	x86_64-w64-mingw32-windres -i $(PROJECT).rc --input-format=rc --codepage=65001 -o $(PROJECT).res -O coff
	x86_64-w64-mingw32-gcc $(PROJECT).c $(PROJECT).res -o $(PROJECT).exe   -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2
	x86_64-w64-mingw32-strip $(PROJECT).exe

sercp.w32: $(PROJECT).c
	rm -f $(PROJECT).res
	i686-w64-mingw32-windres -i $(PROJECT).rc --input-format=rc --codepage=65001 -o $(PROJECT).res -O coff
	i686-w64-mingw32-gcc $(PROJECT).res $(PROJECT).c -o $(PROJECT)32.exe -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2
	i686-w64-mingw32-strip $(PROJECT)32.exe

debug:	$(PROJECT).c
	gcc $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -g -O0

clean:
	rm -f $(PROJECT) $(PROJECT).d $(PROJECT).o