]> Dogcows Code - chaz/yoink/blob - src/rules.mk
fixed documentation about where to find licenses
[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.gz
17 exec += $b/config.c # Make config.c a build target.
18 $b/config.gz: config.mk
19 $(Q)$(gzip)
20 $b/config.c: $b/config.gz
21 $(Q)$(xxd)
22 endif
23
24 $(objects): TGT_CFLAGS := -I$b -I$d
25 $(objects): config.h | $b
26 # Make all objects depend on config.h; it's excessive, but config.h won't be
27 # remade otherwise if dependencies are not being generated. The alternative
28 # is to maintain an accurate list of objects with a dependency on config.h.
29
30 ifeq (true,$(pch))
31 $(objects): $b/moof/precompile.hh.gch
32 endif
33
34 exec += $(objects) # Make the objects build targets.
35
36 bindir_$b := $b/$(projectName)$(EXEEXT) # Install executable to bindir.
37 $(bindir_$b): $(objects) $b/moof/libmoof.a $b/stlplus/libstlplus.a
38 $(Q)$(link_cc)
39
40 #
41 # Define the run and debug targets.
42 #
43
44 run: $(bindir_$b)
45 $(Q)$< $(YOINKFLAGS)
46
47 debug: $(bindir_$b)
48 $(Q)gdb $<
49
50 .PHONY: run debug
51
This page took 0.036359 seconds and 4 git commands to generate.