annotate Makefile @ 289:b67a118dbdb7 ccdev

Updated Makefile to install additonal components of lwcc Unlike lwasm, lwlink, and lwar, lwcc requires additional runtime support files. Updated the Makefile to install them.
author William Astle <lost@l-w.ca>
date Sun, 08 Sep 2013 16:55:21 -0600
parents fc76f1a0dc49
children 40ecbd5da481
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
10 LWTOOLS_VERSION = 4.8
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
11 LWTOOLS_VERSION_SUFFIX = -devcc
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
12
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
13 PACKAGE_VERSION = $(LWTOOLS_VERSION)$(LWTOOLS_VERSION_SUFFIX)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
14
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
15 ifeq ($(PREFIX),)
275
776a076d1afa Makefile: Allow DESTDIR for distribution package creation
Tormod Volden <debian.tormod@gmail.com>
parents: 272
diff changeset
16 ifneq ($(DESTDIR),)
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
17 PREFIX = /usr
275
776a076d1afa Makefile: Allow DESTDIR for distribution package creation
Tormod Volden <debian.tormod@gmail.com>
parents: 272
diff changeset
18 else
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
19 PREFIX = /usr/local
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
20 endif
275
776a076d1afa Makefile: Allow DESTDIR for distribution package creation
Tormod Volden <debian.tormod@gmail.com>
parents: 272
diff changeset
21 endif
270
35b6787a5b39 Allow make install destination to be overridden
William Astle <lost@l-w.ca>
parents: 269
diff changeset
22
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
23 LIBDIR = $(PREFIX)/lib
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
24 BINDIR = $(PREFIX)/bin
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
25
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
26 INSTALLDIR = $(DESTDIR)$(PREFIX)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
27 INSTALLBIN = $(DESTDIR)$(BINDIR)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
28 INSTALLLIB = $(DESTDIR)$(LIBDIR)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
29
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
30 LWCC_LIBDIR = $(LIBDIR)/lwcc/$(PACKAGE_VERSION)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
31 LWCC_INSTALLLIBDIR = $(DESTDIR)$(LWCC_LIBDIR)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
32
272
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
33 # this are probably pointless but they will make sure
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
34 # the variables are set without overriding the environment
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
35 # or automatic values from make itself.
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
36 CC ?= cc
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
37 AR ?= ar
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
38 RANLIB ?= ranlib
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
39
272
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
40 # Set variables for cross compiling
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
41 ifneq ($(BUILDTPREFIX),)
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
42 CC := $(BUILDTPREFIX)$(CC)
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
43 AR := $(BUILDTPREFIX)$(AR)
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
44 RANLIB := $(BUILDTPREFIX)$(RANLIB)
cfeb196251e4 Fix conditional setting of build tools variables in the makefile
William Astle <lost@l-w.ca>
parents: 271
diff changeset
45 endif
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
46
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
47 CPPFLAGS += -I lwlib -DPACKAGE_STRING='"lwtools $(PACKAGE_VERSION)"'
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
48 CPPFLAGS += -DPREFIX=$(PREFIX) -DLWCC_LIBDIR=$(LWCC_LIBDIR)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
49 CPPFLAGS += -DPROGSUFFIX=$(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
50 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
51
260
c5b1dd523ac4 Make default build use -O3
William Astle <lost@l-w.ca>
parents: 246
diff changeset
52 CFLAGS ?= -O3 -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
53
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
54 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
55 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
56 lwar/lwar$(PROGSUFFIX) \
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
57 lwlink/lwobjdump$(PROGSUFFIX) \
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
58 lwcc/driver/lwcc$(PROGSUFFIX)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
59
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
60 LWCC_LIBBIN_FILES =
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
61 LWCC_LIBLIB_FILES =
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
62 LWCC_LIBINC_FILES =
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
63
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 .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
65 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
66
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
67 lwar_srcs := add.c extract.c list.c lwar.c main.c remove.c replace.c
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
68 lwar_srcs := $(addprefix lwar/,$(lwar_srcs))
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
69
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
70 lwlib_srcs := lw_alloc.c lw_realloc.c lw_free.c lw_error.c lw_expr.c \
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
71 lw_stack.c lw_string.c lw_stringlist.c lw_cmdline.c
190
20ba68be2cd7 Fixed typos with conversion away from rules.make stuff
lost@l-w.ca
parents: 189
diff changeset
72 lwlib_srcs := $(addprefix lwlib/,$(lwlib_srcs))
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
73
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
74 lwlink_srcs := main.c lwlink.c readfiles.c expr.c script.c link.c output.c map.c
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
75 lwobjdump_srcs := objdump.c
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
76 lwlink_srcs := $(addprefix lwlink/,$(lwlink_srcs))
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
77 lwobjdump_srcs := $(addprefix lwlink/,$(lwobjdump_srcs))
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
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
79 lwasm_srcs := debug.c input.c insn_bitbit.c insn_gen.c insn_indexed.c \
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
80 insn_inh.c insn_logicmem.c insn_rel.c insn_rlist.c insn_rtor.c insn_tfm.c \
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
81 instab.c list.c lwasm.c macro.c main.c os9.c output.c pass1.c pass2.c \
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
82 pass3.c pass4.c pass5.c pass6.c pass7.c pragma.c pseudo.c section.c \
222
03f7192fcd20 Add --unicorns option for IDE integration
William Astle <lost@l-w.ca>
parents: 213
diff changeset
83 struct.c symbol.c unicorns.c
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
84 lwasm_srcs := $(addprefix lwasm/,$(lwasm_srcs))
188
b6685a7ec2bd Add stub for lwcc
lost@l-w.ca
parents: 181
diff changeset
85
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
86 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
87 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
88 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
89 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
90 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
91
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 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
93 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
94 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
95 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
96 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
97
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
98 lwcc_driver_srcs := main.c
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
99 lwcc_driver_srcs := $(addprefix lwcc/driver/,$(lwcc_driver_srcs))
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
100 lwcc_driver_objs := $(lwcc_driver_srcs:.c=.o)
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
101 lwcc_driver_deps := $(lwcc_driver_srcs:.c=.d)
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
102
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
103 .PHONY: lwlink lwasm lwar lwobjdump lwcc
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
104 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
105 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
106 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
107 lwobjdump: lwlink/lwobjdump$(PROGSUFFIX)
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
108 lwcc: lwcc/driver/lwcc
22
7c35fa8dbc91 Added initial framework for lwbasic
lost@l-w.ca
parents: 20
diff changeset
109
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
110 lwasm/lwasm$(PROGSUFFIX): $(lwasm_objs) lwlib
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
111 @echo Linking $@
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
112 @$(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
113
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
114 lwlink/lwlink$(PROGSUFFIX): $(lwlink_objs) lwlib
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
115 @echo Linking $@
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
116 @$(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
117
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
118 lwlink/lwobjdump$(PROGSUFFIX): $(lwobjdump_objs) lwlib
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
119 @echo Linking $@
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
120 @$(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
121
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
122 lwar/lwar$(PROGSUFFIX): $(lwar_objs) lwlib
17
4969bd6f3b7d Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents: 16
diff changeset
123 @echo Linking $@
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
124 @$(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
125
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
126 lwcc/driver/lwcc$(PROGSUFFIX): $(lwcc_driver_objs) lwlib
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
127 @echo Linking $@
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
128 @$(CC) -o $@ $(lwcc_driver_objs) $(LDFLAGS)
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
129
17
4969bd6f3b7d Fixed up glitch with Makefile causing binaries to always be considered out of date
lost@l-w.ca
parents: 16
diff changeset
130 #.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
131 .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
132 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
133
190
20ba68be2cd7 Fixed typos with conversion away from rules.make stuff
lost@l-w.ca
parents: 189
diff changeset
134 lwlib/liblw.a: $(lwlib_objs)
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
135 @echo Linking $@
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
136 @$(AR) rc $@ $(lwlib_objs)
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
137 @$(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
138
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
139 alldeps := $(lwasm_deps) $(lwlink_deps) $(lwar_deps) $(lwlib_deps) ($lwobjdump_deps) $(lwcc_deps)
3
d4eb3c328a47 Typo fixes
lost@l-w.ca
parents: 2
diff changeset
140
d4eb3c328a47 Typo fixes
lost@l-w.ca
parents: 2
diff changeset
141 -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
142
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
143 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
144
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
145 %.o: %.c
181
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
146 @echo "Building dependencies for $@"
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
147 @$(CC) -MM $(CPPFLAGS) -o $*.d $<
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
148 @mv -f $*.d $*.d.tmp
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
149 @sed -e 's|.*:|$*.o $*.d:|' < $*.d.tmp > $*.d
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
150 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
5350ce9f446f Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
lost@l-w.ca
parents: 173
diff changeset
151 @rm -f $*.d.tmp
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
152 @echo Building $@
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
153 @$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
154
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
155
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
156 .PHONY: clean
22
7c35fa8dbc91 Added initial framework for lwbasic
lost@l-w.ca
parents: 20
diff changeset
157 clean: $(cleantargs)
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
158 @echo "Cleaning up"
269
1c70570e3d42 Remove references to lwbasic and lwcc directories from the Makefile
William Astle <lost@l-w.ca>
parents: 260
diff changeset
159 @rm -f lwlib/liblw.a lwasm/lwasm$(PROGSUFFIX) lwlink/lwlink$(PROGSUFFIX) lwlink/lwobjdump$(PROGSUFFIX) lwar/lwar$(PROGSUFFIX)
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
160 @rm -f lwcc/driver/lwcc$(PROGSUFFIX)
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
161 @rm -f $(lwcc_driver_ojbs)
269
1c70570e3d42 Remove references to lwbasic and lwcc directories from the Makefile
William Astle <lost@l-w.ca>
parents: 260
diff changeset
162 @rm -f $(lwasm_objs) $(lwlink_objs) $(lwar_objs) $(lwlib_objs) $(lwobjdump_objs)
11
a0317b794b7b Make output tidying
lost@l-w.ca
parents: 10
diff changeset
163 @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
164 @rm -f */*.exe
2
7317fbe024af Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents: 1
diff changeset
165
16
2f98cf1558e1 Added building of manual from docbook source to Makefile
lost@l-w.ca
parents: 11
diff changeset
166 .PHONY: realclean
22
7c35fa8dbc91 Added initial framework for lwbasic
lost@l-w.ca
parents: 20
diff changeset
167 realclean: clean $(realcleantargs)
16
2f98cf1558e1 Added building of manual from docbook source to Makefile
lost@l-w.ca
parents: 11
diff changeset
168 @echo "Cleaning up even more"
269
1c70570e3d42 Remove references to lwbasic and lwcc directories from the Makefile
William Astle <lost@l-w.ca>
parents: 260
diff changeset
169 @rm -f $(lwasm_deps) $(lwlink_deps) $(lwar_deps) $(lwlib_deps) $(lwobjdump_deps)
288
fc76f1a0dc49 Initial version of lwcc compiler driver and Makefile infrastructure
William Astle <lost@l-w.ca>
parents: 277
diff changeset
170 @rm -f $(lwcc_driver_deps)
16
2f98cf1558e1 Added building of manual from docbook source to Makefile
lost@l-w.ca
parents: 11
diff changeset
171 @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
172
2
7317fbe024af Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents: 1
diff changeset
173 print-%:
7317fbe024af Clean up insane number of compiler warnings under -Wall
lost@l-w.ca
parents: 1
diff changeset
174 @echo $* = $($*)
3
d4eb3c328a47 Typo fixes
lost@l-w.ca
parents: 2
diff changeset
175
d4eb3c328a47 Typo fixes
lost@l-w.ca
parents: 2
diff changeset
176 .PHONY: install
d4eb3c328a47 Typo fixes
lost@l-w.ca
parents: 2
diff changeset
177 install:
289
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
178 install -d $(INSTALLBIN)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
179 install $(MAIN_TARGETS) $(INSTALLBIN)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
180 install -d $(LWCC_INSTALLLIBDIR)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
181 install -d $(LWCC_INSTALLLIBDIR)/bin
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
182 install -d $(LWCC_INSTALLLIBDIR)/lib
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
183 install -d $(LWCC_INSTALLLIBDIR)/include
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
184 ifneq ($(LWCC_LIBBIN_FILES),)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
185 install $(LWCC_LIBBIN_FILES) $(LIBCC_INSTALLLIBDIR)/bin
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
186 endif
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
187 ifneq ($(LWCC_LIBLIB_FILES),)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
188 install $(LWCC_LIBLIB_FILES) $(LIBCC_INSTALLLIBDIR)/lib
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
189 endif
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
190 ifneq ($(LWCC_LIBINC_FILES),)
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
191 install $(LWCC_LIBINC_FILES) $(LIBCC_INSTALLLIBDIR)/include
b67a118dbdb7 Updated Makefile to install additonal components of lwcc
William Astle <lost@l-w.ca>
parents: 288
diff changeset
192 endif
173
3413a88f4d09 Added test framework
lost@l-w.ca
parents: 126
diff changeset
193
3413a88f4d09 Added test framework
lost@l-w.ca
parents: 126
diff changeset
194 .PHONY: test
3413a88f4d09 Added test framework
lost@l-w.ca
parents: 126
diff changeset
195 test: all test/runtests
3413a88f4d09 Added test framework
lost@l-w.ca
parents: 126
diff changeset
196 @test/runtests
189
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
197
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
198 .PHONY: manual
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
199 manual: manual-html manual-htmlm manual-pdf
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
200
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
201 .PHONY: manual-html
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
202 manual-html: docs/manual/manual.html
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
203
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
204 .PHONY: manual-htmlm
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
205 manual-htmlm: docs/manual/index.html
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
206
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
207 .PHONY: manual-pdf
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
208 manual-pdf: docs/manual/manual.pdf
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
209
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
210 docs/manual/manual.html: docs/manual.docbook.sgml
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
211 docbook2html -o docs -u docs/manual.docbook.sgml && mv docs/manual.docbook.html docs/manual/manual.html
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
212
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
213 docs/manual/index.html: docs/manual.docbook.sgml
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
214 docbook2html -o docs/manual docsmanual.docbook.sgml
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
215
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
216 docs/manual/manual.pdf: docs/manual.docbook.sgml
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
217 docbook2pdf -o docs -u docsmanual.docbook.sgml && mv docs/manual.docbook.pdf docs/manual/manual.pdf && rm -f docs/manual.docbook.html
8a84141ea6dd Removed rules.make stuff in sub directories - it was not particularly helpful
lost@l-w.ca
parents: 188
diff changeset
218