Mercurial > hg > index.cgi
annotate Makefile @ 77:35f6d6a5510f
Fixed typo in static lookup table for indexed modes
author | lost@l-w.ca |
---|---|
date | Wed, 20 Apr 2011 21:42:02 -0600 |
parents | 87026ec7e1c2 |
children | 585cd68253f0 |
rev | line source |
---|---|
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
1 # define anything system specific here |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
2 # |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
3 # set these variables if needed |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
4 # PROGSUFFIX: suffix added to binaries |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
5 # BUILDTPREFIX: prefix added to build utilities (cc, etc.) for xcompile |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
6 # can also set them when invoking "make" |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
7 #PROGSUFFIX := .exe |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
8 #BUILDTPREFIX=i586-mingw32msvc- |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
9 |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
10 # C compiler |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
11 CC := $(BUILDTPREFIX)cc |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
12 |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
13 # ar |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
14 AR := $(BUILDTPREFIX)ar |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
15 |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
16 # ranlib |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
17 RANLIB := $(BUILDTPREFIX)ranlib |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
18 |
69 | 19 CPPFLAGS += -I lwlib -DPACKAGE_STRING='"lwtools 4.0+"' |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
20 LDFLAGS += -L$(PWD)/lwlib -llw |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
21 |
25 | 22 CFLAGS ?= -g -Wall |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
23 |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
24 MAIN_TARGETS := lwasm/lwasm$(PROGSUFFIX) \ |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
25 lwlink/lwlink$(PROGSUFFIX) \ |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
26 lwar/lwar$(PROGSUFFIX) \ |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
27 lwlink/lwobjdump$(PROGSUFFIX) |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
28 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
29 .PHONY: all |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
30 all: $(MAIN_TARGETS) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
31 |
22 | 32 subdirs := lwasm lwlink lwar lwlib lwbasic docs |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
33 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
34 -include $(subdirs:=/rules.make) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
35 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
36 lwasm_objs := $(lwasm_srcs:.c=.o) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
37 lwlink_objs := $(lwlink_srcs:.c=.o) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
38 lwar_objs := $(lwar_srcs:.c=.o) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
39 lwlib_objs := $(lwlib_srcs:.c=.o) |
2
7317fbe024af
Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents:
1
diff
changeset
|
40 lwobjdump_objs := $(lwobjdump_srcs:.c=.o) |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
41 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
42 lwasm_deps := $(lwasm_srcs:.c=.d) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
43 lwlink_deps := $(lwlink_srcs:.c=.d) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
44 lwar_deps := $(lwar_srcs:.c=.d) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
45 lwlib_deps := $(lwlib_srcs:.c=.d) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
46 lwobjdump_deps := $(lwobjdump_srcs:.c=.d) |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
47 |
17
4969bd6f3b7d
Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents:
16
diff
changeset
|
48 .PHONY: lwlink lwasm lwar lwobjdump |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
49 lwlink: lwlink/lwlink$(PROGSUFFIX) |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
50 lwasm: lwasm/lwasm$(PROGSUFFIX) |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
51 lwar: lwar/lwar$(PROGSUFFIX) |
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
52 lwobjdump: lwlink/lwobjdump$(PROGSUFFIX) |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
53 |
22 | 54 .PHONY: lwbasic |
55 lwbasic: lwbasic/lwbasic$(PROGSUFFIX) | |
56 | |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
57 lwasm/lwasm$(PROGSUFFIX): $(lwasm_objs) lwlib lwasm/rules.make |
11 | 58 @echo Linking $@ |
59 @$(CC) -o $@ $(lwasm_objs) $(LDFLAGS) | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
60 |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
61 lwlink/lwlink$(PROGSUFFIX): $(lwlink_objs) lwlib lwlink/rules.make |
11 | 62 @echo Linking $@ |
63 @$(CC) -o $@ $(lwlink_objs) $(LDFLAGS) | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
64 |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
65 lwlink/lwobjdump$(PROGSUFFIX): $(lwobjdump_objs) lwlib lwlink/rules.make |
11 | 66 @echo Linking $@ |
67 @$(CC) -o $@ $(lwobjdump_objs) $(LDFLAGS) | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
68 |
10
127e5b1e01c0
Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
lost@l-w.ca
parents:
9
diff
changeset
|
69 lwar/lwar$(PROGSUFFIX): $(lwar_objs) lwlib lwar/rules.make |
17
4969bd6f3b7d
Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents:
16
diff
changeset
|
70 @echo Linking $@ |
11 | 71 @$(CC) -o $@ $(lwar_objs) $(LDFLAGS) |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
72 |
8
fdc11ef4115b
Switched lwlink to lw_cmdline from argp and also brought in lw_alloc and lw_string to replace util.c
lost@l-w.ca
parents:
3
diff
changeset
|
73 test: test.c lwlib |
fdc11ef4115b
Switched lwlink to lw_cmdline from argp and also brought in lw_alloc and lw_string to replace util.c
lost@l-w.ca
parents:
3
diff
changeset
|
74 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ test.c $(LDFLAGS) |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
75 |
17
4969bd6f3b7d
Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents:
16
diff
changeset
|
76 #.PHONY: lwlib |
4969bd6f3b7d
Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents:
16
diff
changeset
|
77 .INTERMEDIATE: lwlib |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
78 lwlib: lwlib/liblw.a |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
79 |
3 | 80 lwlib/liblw.a: $(lwlib_objs) lwlib/rules.make |
11 | 81 @echo Linking $@ |
82 @$(AR) rc $@ $(lwlib_objs) | |
83 @$(RANLIB) $@ | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
84 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
85 %.d: %.c |
11 | 86 @echo "Building dependencies for $@" |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
87 @$(CC) -MM $(CPPFLAGS) -o $*.d $< |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
88 @mv -f $*.d $*.d.tmp |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
89 @sed -e 's|.*:|$*.o $*.d:|' < $*.d.tmp > $*.d |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
90 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
91 @rm -f $*.d.tmp |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
92 |
3 | 93 alldeps := $(lwasm_deps) $(lwlink_deps) $(lwar_deps) $(lwlib_deps) ($lwobjdump_deps) |
94 | |
95 -include $(alldeps) | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
96 |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
97 extra_clean := $(extra_clean) *~ */*~ |
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
98 |
11 | 99 %.o: %.c |
100 @echo Building $@ | |
101 @$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< | |
102 | |
103 | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
104 .PHONY: clean |
22 | 105 clean: $(cleantargs) |
11 | 106 @echo "Cleaning up" |
107 @rm -f lwlib/liblw.a lwasm/lwasm$(PROGSUFFIX) lwlink/lwlink$(PROGSUFFIX) lwlink/lwobjdump$(PROGSUFFIX) lwar/lwar$(PROGSUFFIX) | |
108 @rm -f $(lwasm_objs) $(lwlink_objs) $(lwar_objs) $(lwlib_objs) $(lwobjdump_objs) | |
109 @rm -f $(extra_clean) | |
20
f4df3bd4b85f
Moved removal of dep files to realclean and properly remove any .exe files
lost@l-w.ca
parents:
17
diff
changeset
|
110 @rm -f */*.exe |
2
7317fbe024af
Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents:
1
diff
changeset
|
111 |
16
2f98cf1558e1
Added building of manual from docbook source to Makefile
lost@l-w.ca
parents:
11
diff
changeset
|
112 .PHONY: realclean |
22 | 113 realclean: clean $(realcleantargs) |
16
2f98cf1558e1
Added building of manual from docbook source to Makefile
lost@l-w.ca
parents:
11
diff
changeset
|
114 @echo "Cleaning up even more" |
20
f4df3bd4b85f
Moved removal of dep files to realclean and properly remove any .exe files
lost@l-w.ca
parents:
17
diff
changeset
|
115 @rm -f $(lwasm_deps) $(lwlink_deps) $(lwar_deps) $(lwlib_deps) $(lwobjdump_deps) |
16
2f98cf1558e1
Added building of manual from docbook source to Makefile
lost@l-w.ca
parents:
11
diff
changeset
|
116 @rm -f docs/manual/*.html docs/manual/*.pdf |
2f98cf1558e1
Added building of manual from docbook source to Makefile
lost@l-w.ca
parents:
11
diff
changeset
|
117 |
2
7317fbe024af
Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents:
1
diff
changeset
|
118 print-%: |
7317fbe024af
Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents:
1
diff
changeset
|
119 @echo $* = $($*) |
3 | 120 |
121 .PHONY: install | |
122 install: | |
123 cp $(MAIN_TARGETS) /usr/local/bin/ | |
0
2c24602be78f
Initial import from lwtools 3.0.1 version, with new hand built build system and file reorganization
lost@l-w.ca
parents:
diff
changeset
|
124 |