All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

GNUmakerules 2.02 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 B. Stoller's avatar
Leigh B. 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) $<

Timothy Stack's avatar
Timothy Stack committed
65 66 67
%.o: %.C
	$(CXX) -c -o $@ $(CXXFLAGS) $<

Timothy Stack's avatar
 
Timothy Stack committed
68 69 70 71 72 73
%_xdr.h: %.x
	rpcgen -h $< > $@

%_xdr.c: %.x %_xdr.h
	rpcgen -c $< > $@

Timothy Stack's avatar
 
Timothy Stack committed
74
%: %-debug
75
	$(STRIP) -o $@$(EXE) $<$(EXE)
Timothy Stack's avatar
 
Timothy Stack committed
76

Timothy Stack's avatar
Timothy Stack committed
77 78 79
%-version.c:
	echo >$@ "char build_info[] = \"Built on `date` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

80 81 82 83 84
#
# Rules to regen configure written files.
#
%: %.in
	@echo "Regenerating $@"
85
	cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status
Timothy Stack's avatar
 
Timothy Stack committed
86 87 88 89 90

ifeq ($(TESTS),)
.PHONY: check
else
check: $(TESTS)
Timothy Stack's avatar
 
Timothy Stack committed
91
	@export SRCDIR=${SRCDIR}; for tst in $^; do \
Timothy Stack's avatar
 
Timothy Stack committed
92 93 94 95 96
		if test `basename $$tst .sh` != `basename $$tst`; then \
			tst="sh $$tst"; \
		fi; \
		if $$tst; then \
			echo "PASS: $$tst"; \
Timothy Stack's avatar
 
Timothy Stack committed
97 98 99
		else \
			echo "FAIL: $$tst"; \
			exit 1; \
Timothy Stack's avatar
 
Timothy Stack committed
100 101 102
		fi \
	done
endif