-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 674 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (24 loc) · 674 Bytes
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
CC = gcc
CXX = g++
CFLAGS = -Werror -Wall -pedantic -std=c11 -fpic
CXXFLAGS = -Werror -Wall -pedantic -std=c++11 -fpic
result = libserialport.so
srcdir = src
incdir = inc
objdir = obj
bindir = bin
VPATH = $(srcdir) $(incdir)
cobjects =
cxxobjects = serialport.o
.PHONY : all clean
all: $(result)
clean:
#rm -vf $(objdir)/$(cobjects)
rm -vf $(objdir)/$(cxxobjects)
rm -vf $(bindir)/$(result)
$(result): $(cobjects) $(cxxobjects)
$(CC) -shared -Wl,-soname,$(result) -o $(bindir)/$@ $(objdir)/$^
$(cobjects): %.o: %.c %.h
$(CC) -I $(incdir) -c $(CFLAGS) -o $(objdir)/$@ $<
$(cxxobjects): %.o: %.cpp %.h
$(CXX) -I $(incdir) -c $(CXXFLAGS) -o $(objdir)/$@ $<