]> Dogcows Code - chaz/yoink/blob - src/rules.mk
build system enhancements
[chaz/yoink] / src / rules.mk
1
2 #
3 # Define rules and targets for Yoink.
4 #
5
6 $(call include,moof stlplus) # Recurse into subdirectories.
7
8 objects = $(patsubst %.c,$(builddir)/%.o,$(patsubst %.cc,$(builddir)/%.o,$(wildcard $d/*.c $d/*.cc)))
9
10 ifeq (win32,$(platform))
11 objects += $b/win32.o # Also compile win32 resource file.
12 endif
13
14 ifeq (true,$(includeConfig))
15 objects += $b/config.o # Also compile in the configuration.
16 exec += $b/config.c # Make config.c a build target.
17 $b/config.c: config.mk
18 $(Q)$(xxd)
19 endif
20
21 $(objects): TGT_CFLAGS := -I$d
22 $(objects): config.h $(this) | $b
23 # Make all objects depend on config.h; it's excessive, but config.h won't
24 # be remade otherwise if dependencies are not being generated. The
25 # alternative is to maintain an accurate list of objects with a dependency
26 # on config.h.
27
28 exec += $(objects) # Make the objects build targets.
29
30 bindir_$b := $b/$(projectName)$(EXEEXT) # Install executable to bindir.
31 $(bindir_$b): $(objects) $b/moof/libmoof.a $b/stlplus/libstlplus.a
32 $(Q)$(link_cc)
33
34 #
35 # Define the run and debug targets.
36 #
37
38 run: $(bindir_$b)
39 $(Q)$< $(YOINKFLAGS)
40
41 debug: $(bindir_$b)
42 $(Q)gdb $<
43
44 .PHONY: run debug
45
This page took 0.03525 seconds and 5 git commands to generate.