ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/Common/common.mk
Revision: 22
Committed: 2008-02-08T06:19:12-08:00 (14 years, 7 months ago) by douglas
File size: 1645 byte(s)
Log Message:
Build system improvements and new projects...

File Contents

# User Rev Content
1 douglas 2 # Truck Computer Dooom!
2     #
3     # Douglas Thrift
4     #
5     # $Id$
6    
7 douglas 15 SHELL :=/usr/local/bin/bash -O extglob -O xpg_echo
8 douglas 17 CPPFLAGS := -MD -I/usr/local/include
9     CXXFLAGS := -Wall -pedantic -g -O2 $(shell $(common)/cpu.sh)
10 douglas 2
11 douglas 15 reset :=\e[0m
12     bright :=\e[1m
13     dim :=\e[2m
14     underscore :=\e[4m
15     blink :=\e[5m
16     reverse :=\e[7m
17     hidden :=\e[8m
18     black :=\e[30m
19     red :=\e[31m
20     green :=\e[32m
21     yellow :=\e[33m
22     blue :=\e[34m
23     magenta :=\e[35m
24     cyan :=\e[36m
25     white :=\e[37m
26     black_ :=\e[40m
27     red_ :=\e[41m
28     green_ :=\e[42m
29     yellow_ :=\e[43m
30     blue_ :=\e[44m
31     magenta_ :=\e[45m
32     cyan_ :=\e[46m
33     white_ :=\e[47m
34 douglas 2
35 douglas 7 %.o: %.cpp
36 douglas 22 @echo "$(bright)$(white)compile\t$(blue)[$(reset)$(<F)$(bright)$(blue)]$(reset)"
37 douglas 7 @$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
38 douglas 22 @echo "$(bright)$(white)compile\t$(green)[$(reset)$(@F)$(bright)$(green)]$(reset)"
39 douglas 16
40     %: %.o
41     @echo "$(bright)$(white)link\t$(blue)[$(reset)$(^F)$(bright)$(blue)]$(reset)"
42     @$(CXX) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
43     @echo "$(bright)$(white)link\t$(green)[$(reset)$(@F)$(bright)$(green)]$(reset)"
44    
45     lib%.a: %.o
46     @echo "$(bright)$(white)archive\t$(blue)[$(reset)$(^F)$(bright)$(blue)]$(reset)"
47     @$(AR) cr $@ $^
48     @echo "$(bright)$(white)archive\t$(green)[$(reset)$(@F)$(bright)$(green)]$(reset)"
49 douglas 22
50     define recurse
51     @echo "$(bright)$(white)enter\t$(blue)[$(reset)$(1)$(bright)$(blue)]$(reset)"
52     @+$(MAKE) --no-print-directory -C $(1) $(2)
53     @echo "$(bright)$(white)leave\t$(green)[$(reset)$(1)$(bright)$(green)]$(reset)"
54     endef
55    
56     define clean
57     clean:
58     @echo "$(bright)$(white)clean\t$(blue)[$(reset)$(1)$(bright)$(blue)]$(reset)"
59     @rm -frv $(1)
60     @echo "$(bright)$(white)clean\t$(green)[$(reset)$(1)$(bright)$(green)]$(reset)"
61     endef

Properties

Name Value
svn:keywords Id