-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile.mingw32
47 lines (33 loc) · 1.3 KB
/
Makefile.mingw32
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
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-gcc
CONFIG_ENABLE_FCS32 ?= y
CONFIG_ENABLE_FCS16 ?= y
CONFIG_ENABLE_CHECKSUM ?= y
CONFIG_ENABLE_STATS ?= y
CONFIG_FOR_WINDOWS_BUILD = y
# ************* Common defines ********************
CPPFLAGS += -I./tools/serial -fPIC -pthread -fexceptions -mwindows -m64 -mwin32 -D_WIN32
CFLAGS += -D_WIN32
LDFLAGS += -L. -lm -shared -Wl,--subsystem,windows -mwindows
#TARGET_LIB ?= tinyprotocol.lib
include Makefile.common
# include Makefile.cpputest
TOOLS_EXT = .exe
TOOLS_LDFLAGS += -L$(BLD) -l tinyprotocol -lm -lpthread -Wl,--subsystem,windows -mwindows -static -lstdc++
OBJ_TINY_LOOPBACK = tools/loopback/tiny_loopback.o
.PHONY: clean release debug
# Default build
all: release
release: tiny_loopback_release
debug: tiny_loopback_debug
tiny_loopback_release: $(OBJ_TINY_LOOPBACK) library
$(CXX) $(CPPFLAGS) -O3 -o $(BLD)/tiny_loopback$(TOOLS_EXT) $(OBJ_TINY_LOOPBACK) $(TOOLS_LDFLAGS)
tiny_loopback_debug: $(OBJ_TINY_LOOPBACK) library
$(CXX) $(CPPFLAGS) -O0 -g -pg -o $(BLD)/tiny_loopback$(TOOLS_EXT) $(OBJ_TINY_LOOPBACK) $(TOOLS_LDFLAGS)
clean: clean_tiny_loopback
clean_tiny_loopback:
ifdef CONFIG_FOR_WINDOWS_BUILD
for /R .\tools\ %%G in (*.o) do del /F/Q/S %%G
else
rm -rf $(OBJ_TINY_LOOPBACK) $(OBJ_TINY_LOOPBACK:.o=.gcno) $(OBJ_TINY_LOOPBACK:.o=.gcda)
endif