Artifact [152ca49ad5]

Artifact 152ca49ad5e8e153b5625ad08fa1d0ed19f6c7fe:


CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
CFLAGS = @CFLAGS@ @SHOBJFLAGS@
CPPFLAGS = @CPPFLAGS@ -I@srcdir@ -I@srcdir@/tcc -Itcc @DEFS@
LDFLAGS =
SHOBJLDFLAGS = @SHOBJLDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
TCLCONFIGPATH = @TCLCONFIGPATH@
PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
TARGETS = @TARGETS@
TCC_CONFIGURE_OPTS = --extra-cflags='$(CFLAGS)' --with-tcl=$(TCLCONFIGPATH)
srcdir = @srcdir@

all: $(TARGETS)

tcc/config.h:
	if [ "$(srcdir)" = "." ]; then \
		cd tcc && ./configure $(TCC_CONFIGURE_OPTS); \
	else \
		mkdir tcc >/dev/null 2>/dev/null; \
		cd tcc && $(shell cd $(srcdir) && pwd)/tcc/configure $(TCC_CONFIGURE_OPTS); \
	fi

tcc/libtcc.a: tcc/config.h
	$(MAKE) -C tcc libtcc.a

tcc/libtcc1.a: tcc/config.h
	$(MAKE) -C tcc libtcc1.a

tcltcc.o: $(srcdir)/tcltcc.c $(srcdir)/tcc/tcc.h $(srcdir)/tcc/libtcc.h tcc/config.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tcltcc.o -c $(srcdir)/tcltcc.c

tcltcc.@SHOBJEXT@: tcltcc.o tcc/libtcc.a
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o tcltcc.@SHOBJEXT@ tcltcc.o tcc/libtcc.a $(LIBS)

tcltcc-static.a: tcltcc.o tcc/libtcc.a
	cp tcc/libtcc.a tcltcc-static.new.a
	$(AR) rcu tcltcc-static.new.a tcltcc.o
	-$(RANLIB) tcltcc-static.new.a
	mv tcltcc-static.new.a tcltcc-static.a

install: $(TARGETS) pkgIndex.tcl tcc.tcl tcc/libtcc1.a $(shell echo tcc/include/*)
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
	$(INSTALL) -m 0755 $(TARGETS) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 tcc.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
	$(INSTALL) -m 0644 $(shell echo tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"

clean:
	rm -f tcltcc.o
	rm -f tcltcc.@SHOBJEXT@ tcltcc-static.a
	rm -f tcltcc.@SHOBJEXT@.a tcltcc.@SHOBJEXT@.def
	-$(MAKE) -C tcc clean

distclean: clean
	rm -rf autom4te.cache
	rm -f config.log config.status
	rm -f pkgIndex.tcl
	rm -f Makefile
	-$(MAKE) -C tcc distclean

mrproper: distclean
	rm -rf __TMP__
	rm -rf tcc
	rm -f configure aclocal.m4
	rm -f config.guess config.sub install-sh

.PHONY: all install clean distclean mrproper