Makefile 8.6 KB
Newer Older
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
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 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
OPENWINHOME=/usr/openwin
DEFAULT_TOOLKIT = xv

# Sun:
# TOOLKITS = olit xv
# Linux:
TOOLKITS = xv

INTERFACE_MODULES = \
	xcursor xfileselect xpath xdialog \
	xkernel xpicture xwindow xmenu xtimer

CLEAN_MODULES = \
	deltaControls deltaFont deltaPicture \
	deltaDialog deltaIOState deltaSystem \
	deltaEventIO deltaIOSystem deltaTimer \
	deltaFileSelect deltaMenu deltaWindow \
	commonDef dialogDef menuDef timerDef \
	windowDef dialogDevice menuDevice timerDevice \
	windowDevice cursorInternal ioState scrollList scrollList sliderBar misc \
	picture xevent xtypes

# Link options files
LO_FILES = \
	x.lo \
	$(TOOLKITS:%=%.lo)

LIBRARY_MODULES = \
	libCleanIO \
	$(TOOLKITS:%=libClean%)

# Static and Dynamic Libraries
LIBRARIES = \
	$(LIBRARY_MODULES:%=%.a)
#	$(LIBRARY_MODULES:%=%.so.1.0) \

# Links to versions of shared libraries
# SHARED_LIB_LINKS = 
#	$(LIBRARY_MODULES:%=%.so)

IOLIB_FILES = \
	$(CLEAN_MODULES:%=%.dcl) \
	$(INTERFACE_MODULES:%=%.dcl) \
	$(CLEAN_MODULES:%=%.icl) \
	$(INTERFACE_MODULES:%=%.icl) \
	$(LO_FILES) \
	$(SHARED_LIB_LINKS) \
	$(LIBRARIES)

#
# Install section
#

# INSTALL_IOLIB_DIR = $(CURRENTDIR)
INSTALL_IOLIB_FILES = $(IOLIB_FILES:%=$(INSTALL_IOLIB_DIR)/%)
INSTALL_SHARED_LIB_LINKS = $(SHARED_LIB_LINKS:%=$(INSTALL_IOLIB_DIR)/%)

install: compile $(INSTALL_IOLIB_DIR) $(INSTALL_IOLIB_FILES) \
											$(INSTALL_SHARED_LIB_LINKS)

$(INSTALL_IOLIB_DIR) :
	mkdir -p $@

$(INSTALL_IOLIB_DIR)/% : %
	cp $< $@
	chmod 644 $@


CURRENTDIR = $(MAKECURRENTDIR)$(GMAKECURRENTDIR)
MAKECURRENTDIR : sh=pwd
GMAKECURRENTDIR = ${shell echo `pwd`}

#
# Compile section
#
compile: $(LIBRARIES)

CLEAN_MODULES_O = $(CLEAN_MODULES:%=Clean\ System\ Files/%.o)
CLEAN_MODULES_O_ = $(CLEAN_MODULES:%=%.o)
INTERFACE_MODULES_O = $(INTERFACE_MODULES:%=Clean\ System\ Files/%.o)
INTERFACE_MODULES_O_ = $(INTERFACE_MODULES:%=%.o)

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

libCleanIO.so.1.0: $(INTERFACE_MODULES_O) $(CLEAN_MODULES_O)
	$(LD) $(LDSHARED) -o $@ $(INTERFACE_MODULES_O) $(CLEAN_MODULES_O)

libCleanIO.a: $(INTERFACE_MODULES_O) $(CLEAN_MODULES_O)
	(cd "Clean System Files" ; $(AR) r ../$@ $(INTERFACE_MODULES_O_) $(CLEAN_MODULES_O_) ; cd ..)
	$(RANLIB) $@

$(TOOLKITS:%=libClean%.a): 
	cd $(@:libClean%.a=%); $(MAKE) ../$@ STATICLIBRARY=../$@ 

$(TOOLKITS:%=libClean%.so.1.0): 
	cd $(@:libClean%.so.1.0=%); $(MAKE) ../$@ DYNAMICLIBRARY=../$@ 

#
# Clean up section
#
cleanup:
	$(RM) $(INTERFACE_MODULES:%=%.icl) $(INTERFACE_MODULES:%=%.dcl) \
			$(INTERFACE_MODULES_ABC) $(INTERFACE_MODULES:%=%.o)
	$(RM) $(CLEAN_MODULES_ABC) $(CLEAN_MODULES_O)
	$(RM) $(LIBRARIES)
	$(RM) $(LO_FILES) $(SHARED_LIB_LINKS)
	for dir in $(TOOLKITS); do cd $$dir; $(MAKE) $@; cd ..; done; exit 0

#
#
# Generate the *.lo files
#
#	delimiter used in the sed patterns, this character may *not*
#	appear in the expansions of $(IOLIB) and $(OPENWINLIB)
DEL = %

OPENWINLIB = $(OPENWINHOME)/lib
IOLIB = $(INSTALL_IOLIB_DIR)

$(INSTALL_IOLIB_DIR)/olit.lo: olit/x.lo.in
	sed -e s\$(DEL)'$$CLEANIOLIB'$(DEL)$(IOLIB)$(DEL)g $? | \
	sed -e s\$(DEL)'$$OPENWINLIB'$(DEL)$(OPENWINLIB)$(DEL)g > $@

$(INSTALL_IOLIB_DIR)/olits.lo: olit/xs.lo.in
	sed -e s\$(DEL)'$$CLEANIOLIB'$(DEL)$(IOLIB)$(DEL)g $? | \
	sed -e s\$(DEL)'$$OPENWINLIB'$(DEL)$(OPENWINLIB)$(DEL)g > $@

$(INSTALL_IOLIB_DIR)/xv.lo: xv/x.lo.in
	sed -e s\$(DEL)'$$CLEANIOLIB'$(DEL)$(IOLIB)$(DEL)g $? | \
	sed -e s\$(DEL)'$$OPENWINLIB'$(DEL)$(OPENWINLIB)$(DEL)g > $@

$(INSTALL_IOLIB_DIR)/xvs.lo: xv/xs.lo.in
	sed -e s\$(DEL)'$$CLEANIOLIB'$(DEL)$(IOLIB)$(DEL)g $? | \
	sed -e s\$(DEL)'$$OPENWINLIB'$(DEL)$(OPENWINLIB)$(DEL)g > $@

$(INSTALL_IOLIB_DIR)/libCleanIO.so: $(INSTALL_IOLIB_DIR)/libCleanIO.so.1.0
	$(RM) $@ ; ln -s $? $@
$(INSTALL_IOLIB_DIR)/libCleanxv.so: $(INSTALL_IOLIB_DIR)/libCleanxv.so.1.0
	$(RM) $@ ; ln -s $? $@
$(INSTALL_IOLIB_DIR)/libCleanolit.so: $(INSTALL_IOLIB_DIR)/libCleanolit.so.1.0
	$(RM) $@ ; ln -s $? $@

$(INSTALL_IOLIB_DIR)/x.lo: $(INSTALL_IOLIB_DIR)/$(DEFAULT_TOOLKIT).lo
	$(RM) $@ ; ln -s $? $@
$(INSTALL_IOLIB_DIR)/xs.lo: $(INSTALL_IOLIB_DIR)/$(DEFAULT_TOOLKIT)s.lo
	$(RM) $@ ; ln -s $? $@

#
# Commands
#

.SUFFIXES: .fcl .icl .dcl .abc .o

RANLIB = ranlib
# RANLIB = /bin/true
FCLC = fclc
CLM = $(HOME)/Clean2/bin/clm
CLMFLAGS = -nw

# Solaris:
# LDSHARED = -G

.fcl.o:
	$(FCLC) $<
	$(CLM) $(CLMFLAGS) -O $*

.fcl.dcl:
	$(FCLC) $<

.fcl.icl:
	$(FCLC) $<

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

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

.abc.o:
	$(CLM) $(CLMFLAGS) -O $*


xcursor.icl : xcursor.fcl

xcursor.dcl : xcursor.fcl

Clean\ System\ Files/xcursor.o : xcursor.icl xcursor.dcl
	$(RM) Clean\ System\ Files/xcursor.abc
	$(CLM) -nw -O xcursor

xfileselect.icl : xfileselect.fcl

xfileselect.dcl : xfileselect.fcl

Clean\ System\ Files/xfileselect.o : xfileselect.icl xfileselect.dcl
	$(RM) Clean\ System\ Files/xfileselect.abc
	$(CLM) -nw -O xfileselect

xpath.icl : xpath.fcl

xpath.dcl : xpath.fcl

Clean\ System\ Files/xpath.o : xpath.icl xpath.dcl
	$(RM) Clean\ System\ Files/xpath.abc
	$(CLM) -nw -O xpath

xdialog.icl : xdialog.fcl

xdialog.dcl : xdialog.fcl

Clean\ System\ Files/xdialog.o : xdialog.icl xdialog.dcl
	$(RM) Clean\ System\ Files/xdialog.abc
	$(CLM) -nw -O xdialog

xkernel.icl : xkernel.fcl

xkernel.dcl : xkernel.fcl

Clean\ System\ Files/xkernel.o : xkernel.icl xkernel.dcl
	$(RM) Clean\ System\ Files/xkernel.abc
	$(CLM) -nw -O xkernel

xpicture.icl : xpicture.fcl

xpicture.dcl : xpicture.fcl

Clean\ System\ Files/xpicture.o : xpicture.icl xpicture.dcl
	$(RM) Clean\ System\ Files/xpicture.abc
	$(CLM) -nw -O xpicture

xwindow.icl : xwindow.fcl

xwindow.dcl : xwindow.fcl

Clean\ System\ Files/xwindow.o : xwindow.icl xwindow.dcl
	$(RM) Clean\ System\ Files/xwindow.abc
	$(CLM) -nw -O xwindow

xmenu.icl : xmenu.fcl

xmenu.dcl : xmenu.fcl

Clean\ System\ Files/xmenu.o : xmenu.icl xmenu.dcl
	$(RM) Clean\ System\ Files/xmenu.abc
	$(CLM) -nw -O xmenu

xtimer.icl : xtimer.fcl

xtimer.dcl : xtimer.fcl

Clean\ System\ Files/xtimer.o : xtimer.icl xtimer.dcl
	$(RM) Clean\ System\ Files/xtimer.abc
	$(CLM) -nw -O xtimer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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