-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (51 loc) · 2.59 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
57
58
59
60
61
62
63
64
65
# We don't know what compiler to use to build fltk on this machine - but fltk-config does...
CC = $(shell fltk-config --cc)
CXX = $(shell fltk-config --cxx)
# Set the flags for compiler: fltk-config knows the basic settings, then we can add our own...
# We don't know what libraries to link with: fltk-config does...
LINKFLTK_GL = $(shell fltk-config --use-gl --ldstaticflags)
LINKFLTK_IMG = $(shell fltk-config --use-images --ldstaticflags)
# Possible steps to run after linking...
STRIP = strip
POSTBUILD = fltk-config --post # Required on OSX, does nothing on other platforms, so safe to call
ifeq ($(OS),Windows_NT)
MAIN_DEPS = main.cxx main_window.h win32_window_manager.h blocked_window.h theme_manager.h select_time_popup.h
EXE_OBJ_DEPS = main.o main_window.o win32_window_manager.o blocked_window.o theme_manager.o select_time_popup.o
CFLAGS = $(shell fltk-config --cflags) -Wall -static
CXXFLAGS = $(shell fltk-config --cxxflags) -Wall -lstdc++fs -static
EXENAME = NoMoreLeeches.exe
LINKFLTK = $(shell fltk-config --ldstaticflags) $(shell pkg-config --libs x11 xmu) -lstdc++fs -static
else
MAIN_DEPS = main.cxx main_window.h x11_window_manager.h blocked_window.h theme_manager.h select_time_popup.h
EXE_OBJ_DEPS = main.o xlib_window_grab.o main_window.o x11_window_manager.o blocked_window.o theme_manager.o select_time_popup.o
CFLAGS = $(shell fltk-config --cflags) $(shell pkg-config --libs x11 xmu) -Wall -static
CXXFLAGS = $(shell fltk-config --cxxflags) $(shell pkg-config --libs x11 xmu) -Wall -lstdc++fs -static
EXENAME = NoMoreLeeches
LINKFLTK = $(shell fltk-config --ldstaticflags) $(shell pkg-config --libs x11 xmu) -lstdc++fs
endif
# Define what your target application is called
all: NoMoreLeeches
# Define how to build the various object files...
select_time_popup.o: select_time_popup.cxx select_time_popup.h
$(CXX) -c $< $(CXXFLAGS)
theme_manager.o: theme_manager.cxx theme_manager.h
$(CXX) -c $< $(CXXFLAGS)
xlib_window_grab.o: xlib_window_grab.c xlib_window_grab.h # a "plain" C file
$(CC) -c $< $(CCFLAGS)
x11_window_manager.o: x11_window_manager.cxx x11_window_manager.h xlib_window_grab.h
$(CXX) -c $< $(CXXFLAGS)
win32_window_manager.o: win32_window_manager.cxx win32_window_manager.h
$(CXX) -c $< $(CXXFLAGS)
main_window.o: main_window.cxx main_window.h # a C++ file
$(CXX) -c $< $(CXXFLAGS)
blocked_window.o: blocked_window.cxx blocked_window.h
$(CXX) -c $< $(CXXFLAGS)
main.o: $(MAIN_DEPS)
$(CXX) -c $< $(CXXFLAGS)
NoMoreLeeches: $(EXE_OBJ_DEPS)
$(CXX) -o $@ $(EXE_OBJ_DEPS) $(LINKFLTK)
$(STRIP) ./$(EXENAME)
clean:
rm *.o $(EXENAME)
run: NoMoreLeeches
./$(EXENAME)