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