ip2net,mdig: improve makefile for windows

This commit is contained in:
bol-van 2024-04-26 17:24:42 +03:00
parent 147af10b61
commit 3098727f4c
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
CC ?= gcc CC ?= gcc
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
CFLAGS_WIN = -static
LIBS = LIBS =
LIBS_WIN = -lws2_32 LIBS_WIN = -lws2_32
SRC_FILES = ip2net.c qsort.c SRC_FILES = ip2net.c qsort.c
@ -21,7 +22,7 @@ mac: $(SRC_FILES)
rm -f ip2netx ip2neta rm -f ip2netx ip2neta
win: $(SRC_FILES) win: $(SRC_FILES)
$(CC) $(CFLAGS) -o ip2net $(SRC_FILES) $(LDFLAGS) $(LIBS_WIN) $(CC) -s $(CFLAGS) $(CFLAGS_WIN) -o ip2net $(SRC_FILES) $(LDFLAGS) $(LIBS_WIN)
clean: clean:
rm -f ip2net *.o rm -f ip2net *.o

View File

@ -1,6 +1,7 @@
CC ?= gcc CC ?= gcc
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
CFLAGS_WIN = -static
LIBS = -lpthread LIBS = -lpthread
LIBS_WIN = -lws2_32 LIBS_WIN = -lws2_32
SRC_FILES = *.c SRC_FILES = *.c
@ -21,7 +22,7 @@ mac: $(SRC_FILES)
rm -f mdigx mdiga rm -f mdigx mdiga
win: $(SRC_FILES) win: $(SRC_FILES)
$(CC) $(CFLAGS) -o mdig -static $(SRC_FILES) $(LDFLAGS) $(LIBS_WIN) $(CC) -s $(CFLAGS) $(CFLAGS_WIN) -o mdig $(SRC_FILES) $(LDFLAGS) $(LIBS_WIN)
clean: clean:
rm -f mdig *.o rm -f mdig *.o