blob: 02bd086d9e06a98c9781063f2608cdf597dc14a1 [file] [log] [blame]
Marc Bouchere6869a82000-03-20 06:03:29 +00001#! /usr/bin/make
2
3all: $(SHARED_LIBS) $(EXTRAS)
4
5clean: $(EXTRA_CLEANS)
6 rm -f $(SHARED_LIBS) $(EXTRAS) $(SHARED_LIBS:%.so=%_sh.o)
7
8install: all $(EXTRA_INSTALLS)
9
10TAGS:
11 @rm -f $@
12 find . -name '*.[ch]' | xargs etags -a
13
14dep: $(DEPFILES) $(EXTRA_DEPENDS)
15 @echo Dependencies will be generated on next make.
Rusty Russell5622f212000-05-02 16:42:09 +000016 rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
Marc Bouchere6869a82000-03-20 06:03:29 +000017
18$(SHARED_LIBS:%.so=%.d): %.d: %.c
19 @-$(CC) -M -MG $(CFLAGS) $< | \
Rusty Russell5622f212000-05-02 16:42:09 +000020 sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
Marc Bouchere6869a82000-03-20 06:03:29 +000021
22$(SHARED_LIBS): %.so : %_sh.o
23 $(LD) -shared -o $@ $<
24
25%_sh.o : %.c
26 $(CC) $(SH_CFLAGS) -o $@ -c $<
27
Marc Bouchere6869a82000-03-20 06:03:29 +000028.makefirst:
29 @echo Making dependencies: please wait...
30 @touch .makefirst
31
Rusty Russell5622f212000-05-02 16:42:09 +000032# This is useful for when dependencies completely screwed
33%.h::
34 @echo Something wrong... deleting dependencies.
Rusty Russellf4a6a0e2000-07-30 01:42:17 +000035 @-rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
36 @[ -d $(KERNEL_DIR)/include/linux/netfilter_ipv4 ] || echo -e '\n\n Please try `make KERNEL_DIR=path-to-correct-kernel'\'.'\n\n'
Rusty Russell5622f212000-05-02 16:42:09 +000037 @exit 1
38
Marc Bouchere6869a82000-03-20 06:03:29 +000039-include $(DEPFILES) $(EXTRA_DEPENDS)
40-include .makefirst