GNUmakerules 1.47 KB
Newer Older
1 2 3
#
# Insert Copyright Here.
#
4 5 6 7 8 9 10 11 12

# Get rid of a bunch of nasty built-in implicit rules,
# to avoid bogus circular dependencies and make things go faster.
# Use the `-r' command line option to make to get even better performance.
.SUFFIXES:

#
# Various install targets.
# 
13 14 15
$(INSTALL_BINDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_BINDIR)
16
	$(INSTALL_PROGRAM) $< $@
17

18 19 20 21 22
$(INSTALL_SBINDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_SBINDIR)
	$(INSTALL_PROGRAM) $< $@

23
$(INSTALL_LIBDIR)/%: %
24
	@echo "Installing $<"
25
	-mkdir -p $(INSTALL_LIBDIR)
26
	$(INSTALL_PROGRAM) $< $@
27

28
$(INSTALL_LIBEXECDIR)/%: %
29
	@echo "Installing $<"
30
	-mkdir -p $(INSTALL_LIBEXECDIR)
31
	$(INSTALL_PROGRAM) $< $@
32

33 34 35 36 37
$(INSTALL_ETCDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_ETCDIR)
	$(INSTALL_DATA) $< $@

38 39
CFLAGS += $(LOCALCFLAGS)

40 41 42
clean:

distclean: clean
43 44 45 46 47 48 49 50
	rm -f GNUmakefile

#
# Where to find source files.
# Using specific patterns instead of the catch-all VPATH variable
# avoids hitting miscellaneous wrong targets in other directories
# when configuring in the source directory.
#
Leigh Stoller's avatar
Leigh Stoller committed
51 52 53 54
vpath %.in  $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath %.c   $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath %.cc  $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath %     $(SRCDIR) $(MOSTLY_SRCDIRS)
55 56 57 58 59 60 61

#
# Define rules which we blew away with .SUFFIXES
# 
%.o: %.c
	$(CC) -c -o $@ $(CFLAGS) $<

62 63 64
%.o: %.cc
	$(CXX) -c -o $@ $(CXXFLAGS) $<

65 66 67 68 69
#
# Rules to regen configure written files.
#
%: %.in
	@echo "Regenerating $@"
70
	cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status