]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - tools/src/tools/ecostest/unix/Makefile
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / tools / src / tools / ecostest / unix / Makefile
1 common_sources = \
2         ../../Utils/common/Properties.cpp       \
3         ../../Utils/common/Subprocess.cpp       \
4         ../../Utils/common/Collections.cpp      \
5         ../../Utils/common/eCosStd.cpp          \
6         ../../Utils/common/eCosThreadUtils.cpp  \
7         ../../Utils/common/eCosTrace.cpp        \
8         ../../Utils/common/eCosSerial.cpp       \
9         ../../Utils/common/eCosSocket.cpp       \
10         ../common/eCosTestUtils.cpp             \
11         ../common/TestResource.cpp              \
12         ../common/ResetAttributes.cpp           \
13         ../common/eCosTest.cpp                  \
14         ../common/eCosTestPlatform.cpp                  \
15         ../common/eCosTestDownloadFilter.cpp    \
16         ../common/eCosTestMonitorFilter.cpp     \
17         ../common/eCosTestSerialFilter.cpp
18
19 common_objects = $(notdir $(common_sources:.cpp=.o))
20
21 all_sources = $(common_sources) ../common/ser_filter.cpp
22
23 programs = ser_filter
24
25
26 CXX=g++
27
28 ifeq ($(shell uname), SunOS)
29 # SunOS
30 LIBS :=  -lpthread -lsocket -lxnet -lstdc++ -lposix4
31 else
32 # Linux
33 LIBS :=  -lpthread -efence -lstdc++
34 endif
35
36 # Look in these directories for source/make files
37 VPATH = .:../common:../../Utils/common
38
39 # Flags
40 CPPFLAGS=-I../../Utils/common -I../common
41 CXXFLAGS=-g -O2 -Wall -D_REENTRANT -D_DEBUG $(CPPFLAGS)
42
43 %.d: %.cpp
44         $(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
45                | sed '\''s#\($*\)\.o[ :]*#\1.o $@ : #g'\'' > $@; \
46                [ -s $@ ] || rm -f $@'
47
48 %.o: %.cpp
49         $(CXX) -c $(CXXFLAGS) -o $@ $<
50
51 .PHONY: all
52 all: $(programs)
53
54 ser_filter: $(common_objects) ser_filter.o
55         $(CXX) -o $@  $(CXXFLAGS) $(LIBPATH) $(LIBS) $^
56
57
58 .PHONY: clean
59 clean:
60         rm -f *.o *.d
61         rm -f $(programs)
62
63 # include the dependency files
64 include $(notdir $(all_sources:.cpp=.d))