a2b218c3d3cad63df6513b3958e1b442b88cf69d
[h316.git] / pc-tools / ldc2 / Makefile
1 APP_NAME=ldc2
2 APP_OBJECTS= main.o silent_code.o configuration_manager.o tool.o config.o
3 CCFLAGS+=-Wall
4
5
6 BUILD_STAMP="\"`uname -a`\""
7 VERSION="\"1.0\""
8 BUILD_DATE="\"`date` \""
9
10 CCFLAGS+=-D BUILD_STAMP=$(BUILD_STAMP) -D VERSION=$(VERSION) -D BUILD_DATE=$(BUILD_DATE)
11
12 BLOCK_OBJECTS=tape_block.o eot_block.o data_block.o broken_block.o\
13 data_block_0_10.o data_block_0_14.o data_block_0_1.o data_block_0_24.o\
14 data_block_0_2.o data_block_0_30.o data_block_0_3.o data_block_0_4.o\
15 data_block_0_50.o data_block_0_54.o data_block_0_60.o data_block_0_44.o\
16 data_block_0_64.o \
17 data_block_0.o data_block_0_0.o\
18 data_block_0_label_extractor.o data_block_1.o data_block_2.o\
19 data_block_3.o data_block_4.o data_block_5.o \
20 data_block_6.o data_block_7.o
21
22
23 OBJECTS=$(BLOCK_OBJECTS) $(APP_OBJECTS)
24
25 SRC_DIR=src
26
27 default: $(APP_NAME)
28
29
30 clean:
31 @rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ ul_timestamp *.dep
32 @$(MAKE) -C doc clean
33
34 APP_SOURCES=$(foreach obj, $(OBJECTS:.o=.cpp),$(SRC_DIR)/$(obj))
35
36 %.dep : $(SRC_DIR)/%.cpp
37 @ echo Building dependencies for $<.
38 @$(SHELL) -c "g++ -M $<" | awk 'BEGIN {N=0}{if(N==0)printf("%s %s\n","$@",$$0);else printf("%s\n", $$0);N+=1;}' > $@
39
40
41 %.o : $(SRC_DIR)/%.cpp %.dep
42 g++ -c $(CCFLAGS) -o $@ $<
43
44 $(APP_NAME) : $(OBJECTS)
45 g++ -o$@ $^
46
47 saustall: $(OBJECTS:.o=.dep)
48
49 doxy/timestamp: $(OBJECTS)
50 @ if [ ! -d doxy ]; then mkdir doxy; fi
51 @doxygen Doxyfile
52 touch $@
53
54 doxy: doxy/timestamp
55
56 upload: ul_timestamp
57
58 ul_timestamp: doxy/timestamp
59 @cd doxy/html && tar -czf /tmp/doxy.tar.gz *
60 @touch ul_timestamp
61 @scp -q /tmp/doxy.tar.gz ente:/tmp/
62 @ssh ente "rm -rf h316.web/ldc-doc/* && cd h316.web/ldc-doc && tar -xzf /tmp/doxy.tar.gz"
63
64 doc:
65 $(MAKE) -C doc
66
67 all: $(APP_NAME) doxy doc
68
69 .PHONY: all clean doxy upload docdata_block_0_0.o default
70
71 .PRECIOUS: *.dep
72
73 #$(OBJECTS:.o=.d)
74
75 %.hh %.cpp:
76 @ echo "Missing file \"$@\"... No problem :-)"
77
78 include $(wildcard *.dep)
79 #include $(OBJECTS:.o=.dep)