-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.server
41 lines (34 loc) · 1.08 KB
/
Makefile.server
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
# Example Project Makefile
# MotionServer
#
# Creates an executable in this directory called MotionServer
EXEC_NAME := "MotionServer"
INCLUDE_DIR := "/usr/local/include/sFoundation/pub"
LIBS := -lsFoundation20 -lpthread -lxmlrpc++ -lxmlrpc_server++ -lxmlrpc_server_abyss++
CC := g++
OPTIMIZATION := -O3
DEBUG_OPTIMIZATION := -O0
CXXFLAGS := -I$(INCLUDE_DIR) $(OPTIMIZATION)
DEBUG_CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -pedantic -g3 $(DEBUG_OPTIMIZATION)
# Specify source files here
ALL_SRC_FILES := $(wildcard *.cpp)
ALL_OBJS := $(patsubst %.cpp,%.o,$(ALL_SRC_FILES))
# Default target
all: MotionServer
# Generic rule to compile a CPP file into an object
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) -o "$@" $<
MotionServer: $(ALL_OBJS)
ifneq ($(RPATH),)
$(CC) -L$(RPATH) -Wl,-rpath=$(RPATH) -o $(EXEC_NAME) $(ALL_OBJS) $(LIBS)
else
$(CC) -o $(EXEC_NAME) $(ALL_OBJS) $(LIBS)
endif
# Remove all object files
.PHONY: clean
clean:
-find . -type f -name "*.o" -delete
# Sayonara. Viciously destroys all build artifacts, including the executable.
.PHONY: real_clean
real_clean: clean
-rm $(EXEC_NAME)