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 | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 5 | # Have to handle extensions which no longer exist. |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 6 | clean: $(EXTRA_CLEANS) |
| 7 | rm -f $(SHARED_LIBS) $(EXTRAS) $(SHARED_LIBS:%.so=%_sh.o) |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 8 | @find . -name '*.[ao]' | xargs rm -f |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 9 | |
| 10 | install: all $(EXTRA_INSTALLS) |
| 11 | |
| 12 | TAGS: |
| 13 | @rm -f $@ |
| 14 | find . -name '*.[ch]' | xargs etags -a |
| 15 | |
| 16 | dep: $(DEPFILES) $(EXTRA_DEPENDS) |
| 17 | @echo Dependencies will be generated on next make. |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 18 | rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 19 | |
| 20 | $(SHARED_LIBS:%.so=%.d): %.d: %.c |
| 21 | @-$(CC) -M -MG $(CFLAGS) $< | \ |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 22 | sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@ |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 23 | |
| 24 | $(SHARED_LIBS): %.so : %_sh.o |
| 25 | $(LD) -shared -o $@ $< |
| 26 | |
| 27 | %_sh.o : %.c |
| 28 | $(CC) $(SH_CFLAGS) -o $@ -c $< |
| 29 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 30 | .makefirst: |
| 31 | @echo Making dependencies: please wait... |
| 32 | @touch .makefirst |
| 33 | |
Rusty Russell | 5622f21 | 2000-05-02 16:42:09 +0000 | [diff] [blame] | 34 | # This is useful for when dependencies completely screwed |
| 35 | %.h:: |
| 36 | @echo Something wrong... deleting dependencies. |
Rusty Russell | f4a6a0e | 2000-07-30 01:42:17 +0000 | [diff] [blame] | 37 | @-rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst |
| 38 | @[ -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] | 39 | @exit 1 |
| 40 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 41 | -include $(DEPFILES) $(EXTRA_DEPENDS) |
| 42 | -include .makefirst |