aboutsummaryrefslogtreecommitdiff
path: root/Makefile.debug
blob: 29c55b2a704e1038f2cb21d986c715bbaea0e5ac (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
CFLAGS = -std=c++11 -I. -ffunction-sections -fdata-sections -Wl,--gc-sections -Os -DCSV_IO_NO_THREAD=1
LDFLAGS =
ifneq ($(BUILD_LINUX),)
WXDIR = wxWidgets-host
CC = g++
CFLAGS += -g
else
WXDIR = wxWidgets-i686-w64-mingw32
CC = i686-w64-mingw32-g++
CFLAGS += -static-libstdc++ -static-libgcc -D_UNICODE=1 -municode -mthreads -mwindows
LDFLAGS += -static -lws2_32 -dynamic
SUFFIX = .exe
OBJSUFFIX = _win
endif

BIN = utool$(SUFFIX)
SRC_FILES = Json.cpp UpdateFactory.cpp UpdateTool.cpp
ifneq ($(BUILD_GUI),)
SRC_FILES += UpdateGUI.cpp JobQueue.cpp
CFLAGS += -DUSE_GUI=1 -Wno-deprecated-declarations $(shell $(WXDIR)/wx-config --cflags)
LDFLAGS += $(shell $(WXDIR)/wx-config --libs std)
endif

SRC = $(patsubst %.cpp,src/%.cpp,$(SRC_FILES))
OBJ = $(SRC:.cpp=$(OBJSUFFIX).o)


%$(OBJSUFFIX).o: %.cpp
	@echo 'Building $@ from $<'
	$(CC) -Wall -c -o $@ $< $(CFLAGS)

$(BIN): $(OBJ)
	@echo 'Linking $^ to $@'
	$(CC) -Wall -o $@ $^ $(CFLAGS) $(LDFLAGS)

all: $(BIN)

clean:
	$(RM) $(BIN) $(OBJ)

.PHONY: all clean