Makefile.static 936 Bytes
Newer Older
Achim Morschhauser's avatar
Achim Morschhauser committed
1
2
3
4
SRC_DIR=./src/
OBJ_DIR=./lib/
HDR_DIR=./include/

5
6
USR_SRC_DIR=./usr/src/
USR_BIN_DIR=./bin/
Achim Morschhauser's avatar
Achim Morschhauser committed
7
8
9
10
11

#--------------------------------------
#--------------------------------------
SRC_FILES  = $(wildcard $(SRC_DIR)*.cpp)
OBJ_FILES  = $(patsubst $(SRC_DIR)%.cpp,$(OBJ_DIR)%.o,$(SRC_FILES))
12
13
USR_FILES  = $(wildcard $(USR_SRC_DIR)*.cpp)
USR_TARGET = $(patsubst $(USR_SRC_DIR)%.cpp,%,$(USR_FILES))
Achim Morschhauser's avatar
Achim Morschhauser committed
14
15
16
17
18
19
20
21
22
23
24
#--------------------------------------
CC=g++

CCFLAGS=-g  -lrt -std=c++11 -pthread

EXCL=driver_serial_emulate.o
# Uncomment to use virtual serial port. Run 'make clean all' afterwards
#EXCL=driver_serial.o

.SECONDARY:

25
all: $(USR_TARGET:%=$(USR_BIN_DIR)%)
Achim Morschhauser's avatar
Achim Morschhauser committed
26

27
%: $(USR_BIN_DIR)%
Achim Morschhauser's avatar
Achim Morschhauser committed
28
29
30
	@echo ---- DONE ----


31
$(USR_BIN_DIR)%: $(filter-out $(OBJ_DIR)$(EXCL) ,$(OBJ_FILES)) $(USR_SRC_DIR)%.cpp
Achim Morschhauser's avatar
Achim Morschhauser committed
32
33
34
35
36
37
	$(CC) $(CCFLAGS) -o $(@) $^ -I./include/

$(OBJ_DIR)%.o: $(SRC_DIR)%.cpp
	$(CC) $(CCFLAGS) -c -o $@ $< -I$(HDR_DIR)

clean:
38
	rm $(USR_BIN_DIR)*
Achim Morschhauser's avatar
Achim Morschhauser committed
39
	rm $(OBJ_DIR)*