Move headers out into their own directory (include/eruntime).
[eruntime.git] / src / Makefile
blob95b430d41cebc3874c389b2fb6c69ff8047e3f28
1 topdir = ..
2 include $(topdir)/Makefile.top
4 all_LIBS = liberuntime.a liberuntime.so
6 common_SOURCES = list.c smalloc.c version.c
8 liberuntime_a_OBJECTS = $(patsubst %.c,%.static.o,$(common_SOURCES))
9 liberuntime_so_OBJECTS = $(patsubst %.c,%.shared.o,$(common_SOURCES))
11 .PHONY: all
12 all: $(all_LIBS)
14 .PHONY: deps
15 deps:
16 $(MKDEPS) $(CC) '$(CFLAGS)' '$(common_SOURCES)'
18 %.static.o: %.c
19 $(call wrap_CC,,$<,$@)
20 %.shared.o: %.c
21 $(call wrap_CC,-fpic -fPIC,$<,$@)
23 liberuntime.a: $(liberuntime_a_OBJECTS)
24 $(call wrap_AR,$@,$^)
25 $(call wrap_RANLIB,$@)
27 liberuntime.so: $(liberuntime_so_OBJECTS)
28 $(call wrap_LD,$@,$^,-shared)
30 .PHONY: install install-libs install-headers
31 install: install-libs install-headers
33 install-libs: $(all_LIBS)
34 @$(INSTALL_DIR) $(DESTDIR)$(libdir) || exit 1; \
35 list='$(all_LIBS)'; for lib in $$list; do \
36 echo "Installing $(DESTDIR)$(libdir)/$$lib..."; \
37 $(INSTALL_BIN) $$lib $(DESTDIR)$(libdir) || exit 1; \
38 done
40 install-headers: install-libs
41 @$(INSTALL_DIR) $(DESTDIR)$(includedir) || exit 1; \
42 list="$$(echo *.h)"; [ "$$list" != '*.h' ] && { \
43 for hdr in $$list; do \
44 echo "Installing $(DESTDIR)$(includedir)/$$lib..."; \
45 $(INSTALL_DATA) $$hdr $(DESTDIR)$(includedir) || exit 1; \
46 done; \
49 .PHONY: clean
50 clean:
51 -rm -f $(all_LIBS) $(liberuntime_a_OBJECTS) $(liberuntime_so_OBJECTS)
53 -include Makefile.deps
55 # vim: ts=8 sw=8 noet fdm=marker tw=80