INSTALL=@INSTALL@ BACKEND_CC := @BACKEND_CC@ LIBRARIES := libcfa.a builtins.cf builtins.c all: ${LIBRARIES} install: all ${INSTALL} -d @CFA_LIBDIR@ ${INSTALL} prelude.cf @CFA_LIBDIR@ ${INSTALL} libcfa.a @CFA_LIBDIR@ # make forward declarations for gcc builtins builtins.c: Makefile builtins.def @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ builtins.cf: builtins.c @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ${INSTALL} builtins.cf @CFA_LIBDIR@ 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