-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 1.23 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
### file guifox-refpersys/Makefile
## SPDX-License-Identifier: MIT
CXX= g++
ASTYLE= astyle
ASTYLEFLAGS= -v -s2 --style=gnu
FXRPS_HOST := $(shell /bin/hostname -f)
FXRPS_ARCH := $(shell /bin/uname -m)
FXRPS_OPERSYS := $(shell /bin/uname -o | /bin/sed 1s/[^a-zA-Z0-9_]/_/g )
CXXSOURCES= $(sort $(wildcard [a-z]*.cc))
OBJECTS= $(patsubst %.cc, %.o, $(CXXSOURCES))
RM= /bin/rm -vf
PACKAGES= fox17 jsoncpp
FXRPS_GIT_ID:= $(shell ./do-generate-gitid.sh)
FXRPS_SHORTGIT_ID:= $(shell ./do-generate-gitid.sh -s)
OPTIMFLAGS= -O2
DEBUGFLAGS= -g3
CXXFLAGS= $(OPTIMFLAGS) $(DEBUGFLAGS) \
-DGIT_ID=\"$(FXRPS_GIT_ID)\" \
-DSHORTGIT_ID=\"$(FXRPS_SHORTGIT_ID)\" \
-DFXRPS_HOST=\"$(FXRPS_HOST)\" -DFXRPS_ARCH=\"$(FXRPS_ARCH)\" \
-DFXRPS_OPERSYS=\"$(FXRPS_OPERSYS)\" \
-DFXRPS_FOXVERSION=\"$(shell fox-config --version)\" \
$(shell pkg-config --cflags $(PACKAGES))
.PHONY: all clean indent
all: foxrps
clean:
$(RM) $(wildcard *.o) foxrps *~ *.orig
foxrps: $(OBJECTS)
$(LINK.cc) $(OBJECTS) $(shell pkg-config --libs $(PACKAGES)) -ldl -o $@
%.o: %.cc foxrps.hh
$(COMPILE.cc) $< -o $@
indent:
for f in $(wildcard [a-z]*.hh) ; do $(ASTYLE) $(ASTYLEFLAGS) $$f ; done
for f in $(wildcard [a-z]*.cc) ; do $(ASTYLE) $(ASTYLEFLAGS) $$f ; done