6 |
|
|
7 |
|
common := $(shell realpath $(CURDIR)/../Common) |
8 |
|
|
9 |
< |
CPPFLAGS := -MD -I/usr/local/include -I$(common) |
9 |
> |
CPPFLAGS := -MD -I/usr/local/include -I$(common) \ |
10 |
> |
$(shell pkg-config --cflags-only-I glib-2.0) |
11 |
|
CXXFLAGS := -Wall -pedantic -g -O2 |
12 |
< |
LDFLAGS := -L/usr/local/lib -L$(common) |
13 |
< |
LDLIBS := -lpcre -ltruck |
12 |
> |
LDFLAGS := -L/usr/local/lib -L$(common) $(shell pkg-config --libs-only-L audacious) \ |
13 |
> |
$(shell pkg-config --libs-only-other audacious) |
14 |
> |
LDLIBS := -lpcre $(shell pkg-config --libs-only-l audacious) |
15 |
|
|
16 |
|
.PHONY: all clean |
17 |
|
|
18 |
|
all: SteeringWheelRemote |
19 |
|
|
20 |
< |
SteeringWheelRemote: SteeringWheelRemote.cpp $(common)/libtruck.a |
21 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LOADLIBES) $(LDLIBS) |
20 |
> |
SteeringWheelRemote: SteeringWheelRemote.o Audacious.o $(common)/libtruck.a |
21 |
> |
@echo [$(+F)] |
22 |
> |
@$(CXX) $(LDFLAGS) -o $@ $+ $(LOADLIBES) $(LDLIBS) |
23 |
> |
@echo [$(@F)] |
24 |
> |
|
25 |
> |
%.o: %.cpp |
26 |
> |
@echo [$(<F)] |
27 |
> |
@$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< |
28 |
> |
@echo [$(@F)] |
29 |
> |
|
30 |
> |
Audacious.o: Audacious.cpp |
31 |
> |
@echo [$(<F)] |
32 |
> |
@$(CXX) $(CPPFLAGS) $(shell pkg-config --cflags-only-I audacious) \ |
33 |
> |
$(filter-out -pedantic,$(CXXFLAGS)) \ |
34 |
> |
$(shell pkg-config --cflags-only-other audacious) -c -o $@ $< |
35 |
> |
@echo [$(@F)] |
36 |
|
|
37 |
|
$(common)/libtruck.a: $(common)/posix.o $(common)/regex.o |
38 |
< |
$(MAKE) -C $(@D) $(@F) |
38 |
> |
@$(MAKE) --no-print-directory -C $(@D) $(@F) |
39 |
|
|
40 |
|
-include *.d |
41 |
|
|
42 |
|
clean: |
43 |
< |
rm -f SteeringWheelRemote *.core *.d |
43 |
> |
@rm -fv SteeringWheelRemote *.core *.d *.o |