Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | #! /usr/bin/make |
| 2 | |
| 3 | all: $(SHARED_LIBS) $(EXTRAS) |
| 4 | |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 5 | experimental: $(EXTRAS_EXP) |
| 6 | |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 7 | # Have to handle extensions which no longer exist. |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 8 | clean: $(EXTRA_CLEANS) |
Rusty Russell | 80daae1 | 2001-01-08 08:36:31 +0000 | [diff] [blame] | 9 | rm -f $(SHARED_LIBS) $(EXTRAS) $(EXTRAS_EXP) $(SHARED_LIBS:%.so=%_sh.o) |
Rusty Russell | cc625ba | 2001-01-14 12:35:28 +0000 | [diff] [blame] | 10 | @find . -name '*.[ao]' -name '*.so' | xargs rm -f |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 11 | |
| 12 | install: all $(EXTRA_INSTALLS) |
Rusty Russell | 7fef194 | 2001-01-08 07:44:46 +0000 | [diff] [blame] | 13 | @if [ -f /usr/local/bin/iptables -a "$(BINDIR)" = "/usr/local/sbin" ];\ |
| 14 | then echo 'Erasing iptables from old location (now /usr/local/sbin).';\ |
| 15 | rm -f /usr/local/bin/iptables;\ |
| 16 | fi |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 17 | |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 18 | install-experimental: $(EXTRA_INSTALLS_EXP) |
| 19 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 20 | TAGS: |
| 21 | @rm -f $@ |
| 22 | find . -name '*.[ch]' | xargs etags -a |
| 23 | |
| 24 | dep: $(DEPFILES) $(EXTRA_DEPENDS) |
| 25 | @echo Dependencies will be generated on next make. |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 26 | rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 27 | |
| 28 | $(SHARED_LIBS:%.so=%.d): %.d: %.c |
| 29 | @-$(CC) -M -MG $(CFLAGS) $< | \ |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 30 | sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@ |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 31 | |
| 32 | $(SHARED_LIBS): %.so : %_sh.o |
| 33 | $(LD) -shared -o $@ $< |
| 34 | |
| 35 | %_sh.o : %.c |
| 36 | $(CC) $(SH_CFLAGS) -o $@ -c $< |
| 37 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 38 | .makefirst: |
| 39 | @echo Making dependencies: please wait... |
| 40 | @touch .makefirst |
| 41 | |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 42 | # This is useful for when dependencies completely screwed |
| 43 | %.h:: |
| 44 | @echo Something wrong... deleting dependencies. |
Rusty Russell | f4a6a0e | 2000-07-30 01:42:17 +0000 | [diff] [blame] | 45 | @-rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst |
| 46 | @[ -d $(KERNEL_DIR)/include/linux/netfilter_ipv4 ] || echo -e '\n\n Please try `make KERNEL_DIR=path-to-correct-kernel'\'.'\n\n' |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 47 | @exit 1 |
| 48 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 49 | -include $(DEPFILES) $(EXTRA_DEPENDS) |
| 50 | -include .makefirst |