blob: 5573ba2c6054f3b286f94a4dd815991e52ef2ae6 [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.
35 -rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
36 @exit 1
37
Marc Bouchere6869a82000-03-20 06:03:29 +000038-include $(DEPFILES) $(EXTRA_DEPENDS)
39-include .makefirst