Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / ColonetServer / Makefile @ 409

History | View | Annotate | Download (1.75 KB)

1 11 emarinel
# ColonetServer makefile
2
3
CC = g++
4 409 emarinel
CFLAGS = -Wall -Wshadow -Wextra -g -pg
5 11 emarinel
6 392 emarinel
COLONETCPPFILES = Main.cpp ColonetServer.cpp wirelessMessageHandler.cpp ConnectionPool.cpp Command.cpp colonet_wireless.cpp
7 11 emarinel
COLONETCPPOBJECTS = $(COLONETCPPFILES:.cpp=.o)
8 23 jknichel
COLONETFILES = options.c
9 11 emarinel
COLONETOBJECTS = $(COLONETFILES:.c=.o)
10 57 jknichel
LOGGINGFILES = Log.cpp
11 11 emarinel
LOGGINGOBJECTS = $(LOGGINGFILES:.cpp=.o)
12
13 61 jknichel
VPATH = ../lib:../lib/colonet_wireless
14 391 emarinel
INCLUDE_DIRS = ../lib/colonet_wireless ../lib ../../libwireless/lib ../lib/colonet_wireless includes
15 158 emarinel
LIBRARY_DIRS = ../lib ../../libwireless/lib ../lib/colonet_wireless
16 61 jknichel
17
#this takes the include directory and puts a -I in front of each directory name before being used in a gcc statement
18
INCLUDE_DIRS_FOR_GCC = $(patsubst %, -I %, $(INCLUDE_DIRS))
19
#this takes the library directory and puts a -L in front of each directory name so it can be used in a gcc statement
20
LIBRARY_DIRS_FOR_GCC = $(patsubst %,-L%, $(LIBRARY_DIRS))
21
22 307 emarinel
.PHONY : all clean run
23 11 emarinel
24
all: ColonetServer
25
26 307 emarinel
run:
27 401 emarinel
	cd ../../libwireless/lib; make colonet
28 307 emarinel
	make; ./ColonetServer
29
	../vision/vision.sh
30
31 392 emarinel
ColonetServer: $(COLONETCPPFILES) $(COLONETFILES) $(LOGGINGFILES)
32 401 emarinel
	cd ../../libwireless/lib; make colonet
33
34 160 jknichel
	@echo "---begin compilation---"
35
	@echo ""
36
	@echo "---create object files---"
37 61 jknichel
	$(CC) $(CFLAGS) -c $(COLONETFILES) $(INCLUDE_DIRS_FOR_GCC)
38
	$(CC) $(CFLAGS) -c $(COLONETCPPFILES) $(INCLUDE_DIRS_FOR_GCC)
39
	$(CC) $(CFLAGS) -c $(LOGGINGFILES) $(INCLUDE_DIRS_FOR_GCC)
40 299 jknichel
	@echo "---finish creating object files---"
41 160 jknichel
	@echo ""
42
	@echo "---link files---"
43 392 emarinel
	$(CC) $(CFLAGS) $(COLONETOBJECTS) $(COLONETCPPOBJECTS) $(LOGGINGOBJECTS) $(LIBRARY_DIRS_FOR_GCC) -lpthread -lwireless_colonet  $(INCLUDE_DIRS_FOR_GCC) -o $@
44 299 jknichel
	@echo "---finish linking files---"
45 160 jknichel
	@echo ""
46
	@echo "---finish compilation---"
47 11 emarinel
48 177 emarinel
clean:
49 161 emarinel
	rm -rf *.o ColonetServer *~