-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (43 loc) · 1.11 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
TARGET = psdebug
SOURCES = src widgets forms
CPPFILES = $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.cpp))
CXXFILES = $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.cxx))
OFILES = $(addprefix build/,$(CPPFILES:.cpp=.o) $(CXXFILES:.cxx=.o))
INCLUDE = -Iforms -Iwidgets -Isrc
LIBDIRS =
LIBS = -ltinyxml2 -lfltk
# Windows specific stuff
ifeq "$(OS)" "Windows_NT"
INCLUDE += -IC:\fltk-1.3.4-1 -IC:\tinyxml2
LIBDIRS += -LC:\fltk-1.3.4-1\lib -LC:\tinyxml2
LIBS += -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -luuid
WINRC = psdebug.rc
WINRES = psdebug.res
ifneq "$(CONF)" "DEBUG"
LDFLAGS = -mwindows
endif
else
WINRC =
WINRES =
endif
ifeq "$(CONF)" "DEBUG"
CFLAGS = -g -O2 -DDEBUG
CXXFLAGS = $(CFLAGS)
else
CFLAGS = -O2
CXXFLAGS = $(CFLAGS)
endif
CC = gcc
CXX = g++
all: $(OFILES) $(WINRES)
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) $(WINRES) -o $(TARGET)
clean:
rm -Rf build $(WINRES) $(TARGET)
build/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
build/%.o: %.cxx
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
%.res: %.rc
windres $< -O coff -o $@