INSTALL=@INSTALL@ BACKEND_CC := @BACKEND_CC@ LIBRARIES := libcfa.a builtins.cf all: $(LIBRARIES) install: all $(INSTALL) -d @CFA_LIBDIR@ $(INSTALL) prelude.cf @CFA_LIBDIR@ $(INSTALL) builtins.cf @CFA_LIBDIR@ $(INSTALL) libcfa.a @CFA_LIBDIR@ # make forward declarations for gcc builtins builtins.cf: Makefile builtins.c builtins.def @BACKEND_CC@ -E builtins.c | sed 's/"//g' > builtins.cf libcfa-prelude.c: ../translator/cfa-cpp prelude.cf builtins.cf sed -i -e "s#typedef.*ptrdiff_t.*#`@BACKEND_CC@ -E ptrdiff_t.c | grep 'typedef.*ptrdiff_t'`#" prelude.cf ../translator/cfa-cpp -l prelude.cf $@ rm -f prelude.c libcfa-prelude.o: libcfa-prelude.c $(BACKEND_CC) -c -o $@ $< libcfa.a: libcfa-prelude.o ar crs $@ $^ EXTRA_OUTPUT += libcfa-prelude.o libcfa-prelude.c # clean-up rule clean: rm -f $(LIBRARIES) $(EXTRA_OUTPUT) distclean: clean