]> git.cworth.org Git - fips/blob - Makefile.local
Start wrapping OpenGL, and print periodic FPS value to stdout.
[fips] / Makefile.local
1 # -*- makefile -*-
2
3 include Makefile.release
4
5 # Smash together user's values with our extra values
6 FINAL_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
7 FINAL_FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(TALLOC_LDFLAGS)
8 FINAL_LIBFIPS_LDFLAGS = $(LDFLAGS) -ldl
9 FINAL_FIPS_LINKER = CC
10 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
11 FINAL_FIPS_LDFLAGS += $(CONFIGURE_LDFLAGS)
12 endif
13
14 .PHONY: all
15 all: fips libfips.so
16
17 ifeq ($(MAKECMDGOALS),)
18 ifeq ($(shell cat .first-build-message 2>/dev/null),)
19         @FIPS_FIRST_BUILD=1 $(MAKE) --no-print-directory all
20         @echo ""
21         @echo "Compilation of fips is now complete. You can install fips with:"
22         @echo ""
23         @echo " make install"
24         @echo ""
25         @echo "Note that depending on the prefix to which you are installing"
26         @echo "you may need root permission (such as \"sudo make install\")."
27         @echo "See \"./configure --help\" for help on setting an alternate prefix."
28         @echo Printed > .first-build-message
29 endif
30 endif
31
32 .PHONY: test
33 test:
34         @echo "FIXME: Should consider adding a test suite here."
35
36 # The user has not set any verbosity, default to quiet mode and inform the
37 # user how to enable verbose compiles.
38 ifeq ($(V),)
39 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
40 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
41 endif
42 # The user has explicitly enabled quiet compilation.
43 ifeq ($(V),0)
44 quiet = @printf "$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
45 endif
46 # Otherwise, print the full command line.
47 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
48
49 %.o: %.c $(global_deps)
50         @mkdir -p .deps/$(@D)
51         $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d
52
53 .PHONY : clean
54 clean:
55         rm -rf $(CLEAN); rm -rf .deps
56
57 .PHONY: distclean
58 distclean: clean
59         rm -rf $(DISTCLEAN)
60
61 # Main program, fips
62
63 fips_srcs = \
64         execute.c \
65         fips.c
66
67 fips_modules = $(fips_srcs:.c=.o)
68
69 fips: $(fips_modules)
70         $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $^ $(FINAL_FIPS_LDFLAGS) -o $@
71
72 # GL-wrapper library, libfips
73 LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym,--no-undefined
74
75 extra_cflags += -I$(srcdir) -fPIC
76
77 libfips_srcs = \
78         glxwrap.c
79
80 libfips_modules = $(libfips_srcs:.c=.o)
81
82 libfips.so: $(libfips_modules) libfips.sym
83         $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $(libfips_modules) $(FINAL_LIBFIPS_LDFLAGS) $(LIBRARY_LINK_FLAGS) -o $@
84
85 .PHONY: install
86 install: all
87         mkdir -p $(DESTDIR)$(bindir)
88         install fips $(DESTDIR)$(bindir)/fips
89         mkdir -p $(DESTDIR)$(libdir)/fips
90         install -m0644 libfips.so $(DESTDIR)$(libdir)/fips/libfips.so
91 ifeq ($(MAKECMDGOALS), install)
92         @echo ""
93         @echo "Fips is now installed to $(DESTDIR)$(prefix)"
94         @echo ""
95 endif
96
97 SRCS  := $(SRCS) $(fips_srcs) $(libfips_srcs)
98 CLEAN := $(CLEAN) fips $(fips_modules) $(libfips_modules)
99
100 DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config
101
102 DEPS := $(SRCS:%.c=.deps/%.d)
103 DEPS := $(DEPS:%.cc=.deps/%.d)
104
105 -include $(DEPS)