#------------------------------------------------------------------------------
# CLiCC: The Common Lisp to C Compiler
# Copyright (C) 1994 Wolfgang Goerigk, Ulrich Hoffmann, Heinz Knutzen
# Christian-Albrechts-Universitaet zu Kiel, Germany
#------------------------------------------------------------------------------
# Function : Generates executable file from C file wich was generated by clicc.
#            Needs parameter SOURCE = <name> and
#            optionally OPTIMIZE = <-{O | g}>.
#            Uses Environment variable CLICCROOT and CROSS386.
#            Called by clicc/bin/cl and clicc/bin/clg.
#
#  $Revision: 1.9 $
#  $Id: makefile.cl386,v 1.9 1994/11/22 15:10:31 hk Exp $
#------------------------------------------------------------------------------

MODULES =
LIBRARIES =
OPTIMIZE = -O# alternative to -O is -g
CFLAGS	= -I$(CLICCROOT)/lib $(OPTIMIZE)
CC	= $(CROSS386)/gcc

ifeq ($(findstring -g,$(OPTIMIZE)), -g)
 RTC	= $(CLICCROOT)/lib/rtc-g.a386
 RTL	= $(CLICCROOT)/lib/rtl-g.a386
 START	= $(CLICCROOT)/lib/main-g.o386
else
 RTC	= $(CLICCROOT)/lib/rtc.a386
 RTL	= $(CLICCROOT)/lib/rtl.a386
 START	= $(CLICCROOT)/lib/main.o386
endif

OMODULES = $(MODULES:%.c=%.o386)
OBJECT = $(SOURCE:%.c=%.o386)
PROGRAM= $(SOURCE:%.c=%.386)

#.KEEP_STATE:

%.o386: %.c
	$(COMPILE.c) $< $(OUTPUT_OPTION)

$(PROGRAM): $(OBJECT) $(RTL) $(RTC) $(START) $(OMODULES)
	$(LINK.c) -o $@ $(START) $(OBJECT) $(OMODULES) \
	$(RTL) $(RTC) $(RTL) $(LIBRARIES) -lm
ViewGit