Makefile.solaris 7.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
#
#	Makefile for the Clean Standard Environment
#

#
#		make (= make stdenv):
#			compiles all modules
#
#		make install:
#			compiles all modules
#			copies files to install directory
#
#		make cleanup:
#			removes all files in this directory that can be recreated
#

CLEAN_MODULES = \
	StdArray StdCharList StdClass StdDebug StdFunc StdList \
	StdOrdList StdOverloaded StdTuple _SystemEnum StdEnum StdEnv

SYSTEM_MODULES = \
	StdBool StdChar StdFile StdInt StdMisc StdReal \
	StdString _SystemArray

ABC_MODULES = \
	_system

OBJECT_MODULES = \
	_startup

SYSTEM_OBJECT_MODULES = \
	_reals crt crti crtn

CLEAN_MODULES_ABC = $(CLEAN_MODULES:%=Clean\ System\ Files/%.abc)

SYSTEM_MODULES_ABC = $(SYSTEM_MODULES:%=Clean\ System\ Files/%.abc)

SYSTEM_MODULES_ICL = $(SYSTEM_MODULES:%=%.icl)

ABC_MODULES_ABC = $(ABC_MODULES:%=Clean\ System\ Files/%.abc)

CLEAN_MODULES_O = $(CLEAN_MODULES:%=Clean\ System\ Files/%.o)

SYSTEM_MODULES_O = $(SYSTEM_MODULES:%=Clean\ System\ Files/%.o)

ABC_MODULES_O = $(ABC_MODULES:%=Clean\ System\ Files/%.o)

OBJECT_MODULES_O = $(OBJECT_MODULES:%=Clean\ System\ Files/%.o)

SYSTEM_OBJECT_MODULES_O = $(SYSTEM_OBJECT_MODULES:%=Clean\ System\ Files/%.o)

STDENV_FILES = \
	$(CLEAN_MODULES:%=%.icl) \
	$(CLEAN_MODULES:%=%.dcl) \
	$(SYSTEM_MODULES:%=%.dcl) \
	$(SYSTEM_MODULES_ABC) \
	$(CLEAN_MODULES_ABC) \
	$(ABC_MODULES_ABC) \
	wait1 \
	$(SYSTEM_MODULES_O) \
	$(CLEAN_MODULES_O) \
	$(ABC_MODULES_O) \
	$(OBJECT_MODULES_O) \
	$(SYSTEM_OBJECT_MODULES_O)

wait1:
	sleep 1

#
# Compile
#

stdenv: $(STDENV_FILES)

#
# Install
#
# the order here is important, because the files will be
# installed in the order given below.

INSTALL_STDENV_FILES = \
	$(CLEAN_MODULES:%=$(INSTALL_STDENV_DIR)/%.icl) \
	$(CLEAN_MODULES:%=$(INSTALL_STDENV_DIR)/%.dcl) \
	$(SYSTEM_MODULES:%=$(INSTALL_STDENV_DIR)/%.dcl) \
	$(ABC_MODULES:%=$(INSTALL_STDENV_DIR)/%.dcl) \
	$(OBJECT_MODULES:%=$(INSTALL_STDENV_DIR)/%.dcl) \
	$(SYSTEM_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.abc) \
	$(CLEAN_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.abc) \
	$(ABC_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.abc) \
	wait2 \
	$(SYSTEM_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.o) \
	$(CLEAN_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.o) \
	$(ABC_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.o) \
	$(OBJECT_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.o) \
	$(SYSTEM_OBJECT_MODULES:%=$(INSTALL_STDENV_DIR)/Clean\ System\ Files/%.o) \
	$(INSTALL_STDENV_DIR)/Clean\ System\ Files/libCleanxv.a

install: stdenv $(INSTALL_STDENV_DIR) $(INSTALL_STDENV_DIR)/Clean\ System\ Files $(INSTALL_STDENV_FILES)

wait2:
	sleep 1

$(INSTALL_STDENV_DIR) : 
	mkdir -p "$@"

$(INSTALL_STDENV_DIR)/Clean\ System\ Files : 
	mkdir -p "$@"

$(INSTALL_STDENV_DIR)/% : %
	cp "$<" "$@"
	chmod 644 "$@"

$(INSTALL_STDENV_DIR)/Clean\ System\ Files/libCleanxv.a :
	$(RM) $(INSTALL_STDENV_DIR)/Clean\ System\ Files/libCleanxv.a; \
	if test -f ../../iolib/libCleanvx.a; \
 	then ln -fs ../../iolib/libCleanxv.a $(INSTALL_STDENV_DIR)/Clean\ System\ Files/libCleanxv.a; \
	else touch ../../libCleanxv.a; ln -fs ../../iolib/libCleanxv.a $(INSTALL_STDENV_DIR)/Clean\ System\ Files/libCleanxv.a; rm ../../libCleanxv.a; \
	fi

#
# Cleanup
#

cleanup:
	$(RM) $(CLEAN_MODULES_ABC) \
	$(RM) $(CLEAN_MODULES_O) \
	$(RM) $(SYSTEM_MODULES_O) \
	$(RM) $(ABC_MODULES_O)

#
# Commands
#

CLM = clm -P .
CLMFLAGS =

.SUFFIXES: .abc .dcl .icl .o

.icl.abc:
	$(CLM) $(CLMFLAGS) -ABC $*

.icl.o:
	$(CLM) $(CLMFLAGS) -O `basename "$*" .icl`

.abc.o:
	$(CLM) $(CLMFLAGS) -O `basename "$*" .icl`


Clean\ System\ Files/StdArray.o : StdArray.icl StdArray.dcl
	$(CLM) -O StdArray

Clean\ System\ Files/StdArray.abc : StdArray.icl StdArray.dcl
	$(CLM) -ABC StdArray

Clean\ System\ Files/StdCharList.o : StdCharList.icl StdCharList.dcl
	$(CLM) -O StdCharList

Clean\ System\ Files/StdCharList.abc : StdCharList.icl StdCharList.dcl
	$(CLM) -ABC StdCharList

Clean\ System\ Files/StdClass.o : StdClass.icl StdClass.dcl
	$(CLM) -O StdClass

Clean\ System\ Files/StdClass.abc : StdClass.icl StdClass.dcl
	$(CLM) -ABC StdClass

Clean\ System\ Files/StdDebug.o : StdDebug.icl StdDebug.dcl
	$(CLM) -O StdDebug

Clean\ System\ Files/StdDebug.abc : StdDebug.icl StdDebug.dcl
	$(CLM) -ABC StdDebug

Clean\ System\ Files/StdEnum.o : StdEnum.icl StdEnum.dcl
	$(CLM) -O StdEnum

Clean\ System\ Files/StdEnum.abc : StdEnum.icl StdEnum.dcl
	$(CLM) -ABC StdEnum

Clean\ System\ Files/StdEnv.o : StdEnv.icl StdEnv.dcl
	$(CLM) -O StdEnv

Clean\ System\ Files/StdEnv.abc : StdEnv.icl StdEnv.dcl
	$(CLM) -ABC StdEnv

Clean\ System\ Files/StdFunc.o : StdFunc.icl StdFunc.dcl
	$(CLM) -O StdFunc

Clean\ System\ Files/StdFunc.abc : StdFunc.icl StdFunc.dcl
	$(CLM) -ABC StdFunc

Clean\ System\ Files/StdList.o : StdList.icl StdList.dcl
	$(CLM) -O StdList

Clean\ System\ Files/StdList.abc : StdList.icl StdList.dcl
	$(CLM) -ABC StdList

Clean\ System\ Files/StdOrdList.o : StdOrdList.icl StdOrdList.dcl
	$(CLM) -O StdOrdList

Clean\ System\ Files/StdOrdList.abc : StdOrdList.icl StdOrdList.dcl
	$(CLM) -ABC StdOrdList

Clean\ System\ Files/StdOverloaded.o : StdOverloaded.icl StdOverloaded.dcl
	$(CLM) -O StdOverloaded

Clean\ System\ Files/StdOverloaded.abc : StdOverloaded.icl StdOverloaded.dcl
	$(CLM) -ABC StdOverloaded

Clean\ System\ Files/StdTuple.o : StdTuple.icl StdTuple.dcl
	$(CLM) -O StdTuple

Clean\ System\ Files/StdTuple.abc : StdTuple.icl StdTuple.dcl
	$(CLM) -ABC StdTuple

Clean\ System\ Files/_SystemEnum.o : _SystemEnum.icl _SystemEnum.dcl
	$(CLM) -O _SystemEnum

Clean\ System\ Files/_SystemEnum.abc : _SystemEnum.icl _SystemEnum.dcl
	$(CLM) -ABC _SystemEnum

Clean\ System\ Files/StdBool.o : StdBool.dcl Clean\ System\ Files/StdBool.abc
	$(CLM) -O StdBool

Clean\ System\ Files/StdBool.abc : StdBool.icl StdBool.dcl
	$(CLM) -ABC StdBool

Clean\ System\ Files/StdChar.o : StdChar.dcl Clean\ System\ Files/StdChar.abc
	$(CLM) -O StdChar

Clean\ System\ Files/StdChar.abc : StdChar.icl StdChar.dcl
	$(CLM) -ABC StdChar

Clean\ System\ Files/StdFile.o : StdFile.dcl Clean\ System\ Files/StdFile.abc
	$(CLM) -O StdFile

Clean\ System\ Files/StdFile.abc : StdFile.icl StdFile.dcl
	$(CLM) -ABC StdFile

Clean\ System\ Files/StdInt.o : StdInt.dcl Clean\ System\ Files/StdInt.abc
	$(CLM) -O StdInt

Clean\ System\ Files/StdInt.abc : StdInt.icl StdInt.dcl
	$(CLM) -ABC StdInt

Clean\ System\ Files/StdMisc.o : StdMisc.dcl Clean\ System\ Files/StdMisc.abc
	$(CLM) -O StdMisc

Clean\ System\ Files/StdMisc.abc : StdMisc.icl StdMisc.dcl
	$(CLM) -ABC StdMisc

Clean\ System\ Files/StdReal.o : StdReal.dcl Clean\ System\ Files/StdReal.abc
	$(CLM) -O StdReal

Clean\ System\ Files/StdReal.abc : StdReal.icl StdReal.dcl
	$(CLM) -ABC StdReal

Clean\ System\ Files/StdString.o : StdString.dcl Clean\ System\ Files/StdString.abc
	$(CLM) -O StdString

Clean\ System\ Files/StdString.abc : StdString.icl StdString.dcl
	$(CLM) -ABC StdString

Clean\ System\ Files/_SystemArray.o : _SystemArray.dcl Clean\ System\ Files/_SystemArray.abc
	$(CLM) -O _SystemArray

Clean\ System\ Files/_SystemArray.abc : _SystemArray.icl _SystemArray.dcl
	$(CLM) -ABC _SystemArray

Clean\ System\ Files/_system.o : Clean\ System\ Files/_system.abc
	$(CLM) -O _system

# compile system modules twice, to make sure all inlining is done
system_abc: $(SYSTEM_MODULES_ABC) system_abc_touch

system_abc_touch:
	touch $(SYSTEM_MODULES_ICL)
	$(MAKE) system_abc_again

system_abc_again: $(SYSTEM_MODULES_ABC)