aboutsummaryrefslogtreecommitdiffstats
path: root/GNUmakefile
blob: 25ed1a68fcde6363659067ced721ff096ee8ff83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
include Makefile

SRCS = $(OBJS:.o=.c)

test-link: $(OBJS)
	$(CC) $(DLDFLAGS) -o .testlink $(OBJS) $(LIBPATH) $(LIBS) $(LOCAL_LIBS)
	@$(RM) .testlink
	@echo "Done."

dep: $(SRCS)
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $^ -MM | \
	$(RUBY) -p -e 'BEGIN{S = []' \
		-e 'while !ARGV.empty? and /^(\w+)=(.*)/ =~ ARGV[0]' \
		  -e 'S << [/#{Regexp.quote($$2)}\//, "$$(#{$$1})/"]' \
		  -e 'ARGV.shift' \
		-e 'end' \
		-e '}' -e 'S.each(&method(:gsub!))' -- \
            'topdir=$(topdir)' 'srcdir=$(srcdir)' 'hdrdir=$(hdrdir)' \
	> dep

include dep