From c658bf9a9e38731e08a0526972c0c911c1980c65 Mon Sep 17 00:00:00 2001 From: Pavel Vymetálek Date: Wed, 27 Feb 2019 09:49:13 +0100 Subject: Doplněn odkaz GNU/GPL, řízení toku RTS/CTS na Windows, doplěn .rc soubor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3163e3b..4cb7232 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,34 @@ PROJECT=sercp -all: $(PROJECT) $(PROJECT).w32 $(PROJECT).w64 +PREFIX=/usr/local +CC=gcc +WINCC_PREFIX=i686-w64-mingw32 +WINCC64_PREFIX=x86_64-w64-mingw32 + +all: $(PROJECT) + +windows: $(PROJECT).w32 $(PROJECT).w64 sercp: $(PROJECT).c - gcc $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2 + $(CC) $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2 + +install: $(PROJECT) + install -d $(DESTDIR)$(PREFIX)/bin/ + install -m 755 $< $(DESTDIR)$(PREFIX)/bin/ 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 + $(WINCC64_PREFIX)-windres -i $(PROJECT).rc --input-format=rc --codepage=65001 -o $(PROJECT).res -O coff + $(WINCC64_PREFIX)-gcc $(PROJECT).c $(PROJECT).res -o $(PROJECT).exe -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2 + $(WINCC64_PREFIX)-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 + $(WINCC_PREFIX)-windres -i $(PROJECT).rc --input-format=rc --codepage=65001 -o $(PROJECT).res -O coff + $(WINCC_PREFIX)-gcc $(PROJECT).res $(PROJECT).c -o $(PROJECT)32.exe -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -O2 + $(WINCC_PREFIX)-strip $(PROJECT)32.exe debug: $(PROJECT).c - gcc $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -g -O0 + $(CC) $(PROJECT).c -o $(PROJECT) -Wall -pedantic -MP -MD -std=gnu11 -Werror=format-security -g -O0 clean: rm -f $(PROJECT) $(PROJECT).d $(PROJECT).o $(PROJECT).res $(PROJECT)*.d $(PROJECT)*.exe -- cgit