Subject: Makefile for V1.16 under gnu-win32

From: "Dr. Wai Wong" <[email-masked]>
Date: Tue, 28 Jan 1997 12:05:43 +0800 (HKT)

Below are the Config.mk file and the makefile in srcwin directory I used
to build the V library under gnu-win32. Hope they are useful for anyone
try building V using gnu-win32.

-------------- Config.mk --------------------------------------
#===============================================================
# V Make Configuration file - Version 1.16 for cyg-win32 - 27-1-97
# Copyright (C) 1997 W. Wong
# Based on the original Makefile by Bruce E. Wampler
#
# Copyright (C) 1995,1996  Bruce E. Wampler
#
# This file is part of the V C++ GUI Framework, and is covered
# under the terms of the GNU Library General Public License,
# Version 2. This library has NO WARRANTY. See the source file
# vapp.cxx for more complete information about license terms.
#===============================================================

#---------------------------------------------------------------------
# Version info
#---------------------------------------------------------------------
VV	=	1.16
VVW	=	116

#---------------------------------------------------------------------
# HOMEV info -- change this to point to the root of V
#---------------------------------------------------------------------
HOMEV	=	/unix/v

#---------------------------------------------------------------------
# Tools used in the makefile execution
#---------------------------------------------------------------------
CC	=	gcc
CXX	=	g++

#---------------------------------------------------------------------
# VPATH for dependencies on header files
#---------------------------------------------------------------------
VPATH=$(HOMEV)/includew/v

#---------------------------------------------------------------------
# Select the architecture of your system.
# These are the architectures that V has been extensively tested with:
# linujx, linuelf, sun4, mips, sgi
# For I486 or i586 choose: intel.
# User contributed definitions are available for:
# hpux, aix, solaris, bsd
#---------------------------------------------------------------------
ARCH	= gnu-win

Arch = $(ARCH)

#---------------------------------------------------------------------
# Select Athena or Motif TOOLKIT option.
# NOTE: The Motif version is NOT complete!!! It really doesn't
# work yet! However, there are some ifeqs in this makefile
# for compiling Motif. You can try them, but the result does NOT work!
#---------------------------------------------------------------------
#TOOLKIT	= Motif
#TOOLKIT	= Athena

#---------------------------------------------------------------------
# Use this define for NO 3D on Athena Widgets
# For Motif use NO 3D i.e. USE_3D=no.
#---------------------------------------------------------------------
ifeq ($(TOOLKIT),Motif)
USE_3D = no
else
USE_3D = yes
endif

#---------------------------------------------------------------------
# Select X11R-version
#---------------------------------------------------------------------
#X11RV	= X11R5
#X11RV	= X11R6

#---------------------------------------------------------------------
# Select Debug or no Debug
#---------------------------------------------------------------------
#DEBUG	=	yes
DEBUG	= no

#---------------------------------------------------------------------
# Define filename extensions that are targeted by cleanup's
#---------------------------------------------------------------------
CLEANEXTS= *.bak *~ *.tmp

#---------------------------------------------------------------------
# Architecture dependent constants
#---------------------------------------------------------------------
SSUF	=	.cpp
RANLIB = ranlib

#---------------------------------------------------------------------
# Architecture dependent directory locations
#---------------------------------------------------------------------
VLibDir	=	$(HOMEV)/lib/$(Arch)

oDir	=	$(HOMEV)/obj/$(Arch)

LibDir	=	$(HOMEV)/lib/$(Arch)
Bin	=	$(HOMEV)/bin/$(Arch)

#---------------------------------------------------------------------
# Architecture independent 
#---------------------------------------------------------------------
INCDIR	=	-I$(HOMEV)/includew
LIBDIR	=	-L$(LibDir)

LIBNAME	= libV
V1NAME 	= v1
#LIBS	= -lV -lXaw
LIBS = -lV -lcygwin -lcomdlg32 -lkernel32 -luser32 -ladvapi32 -lgdi32

#---------------------------------------------------------------------
# C/C++ compile options
#---------------------------------------------------------------------
#CFLAGS	+= -v $(INCDIR) 
CFLAGS	+= $(INCDIR) 
ifeq ($(DEBUG),no)
CFLAGS	+=	-O
endif
ifeq ($(DEBUG),yes)
CFLAGS	+=	-g
endif

#---------------------------------------------------------------------
# LINK/LOAD options
#---------------------------------------------------------------------
LDFLAGS	=	$(LIBDIR) $(LIBS)

-------------------------- Makefile in srcwin -----------------------

#===============================================================
# V Libray Build Makefile for gnu-win32 - Version 1.16 - 27/1/97
# based on the original Makefile for unix platforms
# This file should be placed in the srcwin directory
# Copyright (C) 1997 W. Wong
#
# V Libray Build Makefile - Version 1.15 - 11/14/96
#
# Copyright (C) 1995,1996  Bruce E. Wampler
#
# This file is part of the V C++ GUI Framework, and is covered
# under the terms of the GNU Library General Public License,
# Version 2. This library has NO WARRANTY. See the source file
# vapp.cxx for more complete information about license terms.
#===============================================================
#
# Available targets: 
#	
#	default	: vlib
#	vlib	: builds V library
#	clean	: removes backup stuff
#
#===============================================================

CONFIG = ../Config.mk
include $(CONFIG)

#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# fix library name and C/C++ compile options for the library build
#
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

ifeq ($(USE_3D),no)
	CFLAGS	+= -DNO_V_3D
endif
ifeq ($(Arch),linuxelf)
	CFLAGSLIB	= -fpic $(CFLAGS)
else
	CFLAGSLIB	= $(CFLAGS)
endif

#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# Object and header file lists
#
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

LibObjs	=\
	$(oDir)/vapp.o \
	$(oDir)/vawinfo.o \
	$(oDir)/vbaseitm.o \
	$(oDir)/vbasewin.o \
	$(oDir)/vboxlblc.o \
	$(oDir)/vbrush.o \
	$(oDir)/vbtncmd.o \
	$(oDir)/vcanvas.o \
	$(oDir)/vcbtncmd.o \
	$(oDir)/vchkboxc.o \
	$(oDir)/vclabelc.o \
	$(oDir)/vcmd.o \
	$(oDir)/vcmdpane.o \
	$(oDir)/vcmdprnt.o \
	$(oDir)/vcmdwin.o \
	$(oDir)/vcolor.o \
	$(oDir)/vcomboc.o \
	$(oDir)/vcpdc.o \
	$(oDir)/vdebug.o \
	$(oDir)/vdialog.o \
	$(oDir)/vfilesel.o \
	$(oDir)/vfinddlg.o \
	$(oDir)/vfont.o \
	$(oDir)/vfontsel.o \
	$(oDir)/vframec.o \
	$(oDir)/vicon.o \
	$(oDir)/vlabelc.o \
	$(oDir)/vlistc.o \
	$(oDir)/vmemdc.o \
	$(oDir)/vmenu.o \
	$(oDir)/vmodald.o \
	$(oDir)/vnotice.o \
	$(oDir)/vpen.o \
	$(oDir)/vprogrsc.o \
	$(oDir)/vradioc.o \
	$(oDir)/vreply.o \
	$(oDir)/vsliderc.o \
	$(oDir)/vspinc.o \
	$(oDir)/vtextc.o \
	$(oDir)/vtextcnv.o \
	$(oDir)/vtexted.o \
	$(oDir)/vtextinc.o \
	$(oDir)/vthislst.o \
	$(oDir)/vtimer.o \
	$(oDir)/vutil.o \
	$(oDir)/vwindc.o \
	$(oDir)/vwindow.o \
	$(oDir)/vwinprdc.o \
	$(oDir)/vwinprtr.o \
	$(oDir)/vynreply.o

ifeq ($(TOOLKIT),Motif)
Lib3dObjs	=
endif
ifeq ($(TOOLKIT),Athena)
Lib3dObjs=\
	$(oDir)/aw3d.o \
	$(oDir)/awcmd3d.o \
	$(oDir)/awlbl3d.o \
	$(oDir)/awscl3d.o \
	$(oDir)/awsld3d.o \
	$(oDir)/awsim3d.o \
	$(oDir)/awtog3d.o
endif

BASEDEP = v_defs.h vbaseitm.h vbasewin.h vapp.h vwin32.h

PANEDEP	= vpane.h vwindow.h

CMDDEP	= v_defs.h vdialog.h vcmd.h vcmdprnt.h

CMDS	=\
	vbtncmd.h vcbtncmd.h vlabelc.h vframec.h vchkboxc.h vradioc.h \
	vprogrsc.h vsliderc.h vtextinc.h vlistc.h vcomboc.h vtextc.h \
	vcolor.h vpen.h vclabelc.h vspinc.h

#	cd iconed ; $(MAKE) ARCH=$@ ; cd ..

#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# targets
#
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

.PHONY: default
default: vlib

.PHONY: clean
clean:
	-rm -f $(CLEANEXTS)

#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# target for building the v library
#
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

.PHONY:	vlib

ifeq ($(Arch),linuxelf)
vlib:	$(Bin) $(oDir) $(LibDir) $(LibDir)/$(LIBNAME).so.$(VV)

$(Bin) $(oDir) $(LibDir):
	[ -d $@ ] || mkdir -p $@

$(LibDir)/$(LIBNAME).so.$(VV):	$(LibObjs) $(Lib3dObjs)
	rm -f $(LibDir)/$(LIBNAME).so.$(VV)
	$(CXX) -shared -Wl,-soname,$(LIBNAME).so.1 \
		-o $(LibDir)/$(LIBNAME).so.$(VV) $(LibObjs) $(Lib3dObjs)
	(cd $(VLibDir); \
		rm -f $(LIBNAME).so.1; \
		ln -s $(LIBNAME).so.$(VV) $(LIBNAME).so.1; \
		rm -f $(LIBNAME).so; \
		ln -s $(LIBNAME).so.$(VV) $(LIBNAME).so)
else
vlib:	$(LibDir)/$(LIBNAME).a

$(LibDir)/$(LIBNAME).a:	$(LibObjs)
	rm -f $(LibDir)/$(LIBNAME).a
	$(AR) cr $(LibDir)/$(LIBNAME).a $(LibObjs)
	$(RANLIB) $(LibDir)/$(LIBNAME).a
	chmod 644 $(LibDir)/$(LIBNAME).a
endif

#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
#    .o's for the library
#
#  note: $@ gives target ($(oDir)/xx.o, 
#	$< gives first dependency (xx.cxx)
#	$(CXX) -c $(CFLAGS) -o $@ $<
#
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

$(oDir)/vapp.o:	vapp$(SSUF) $(BASEDEP) vfont.h vawinfo.h vcmdwin.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vawinfo.o:	vawinfo$(SSUF) $(BASEDEP) vawinfo.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vbaseitm.o:	vbaseitm$(SSUF) vbaseitm.h v_defs.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vbasewin.o:	vbasewin$(SSUF) $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vboxlblc.o:	vboxlblc$(SSUF) $(BASEDEP) vboxlblc.h vcmdprnt.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vbrush.o:	vbrush$(SSUF) $(BASEDEP) vbrush.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vbtncmd.o:	vbtncmd$(SSUF) vbtncmd.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcanvas.o:	vcanvas$(SSUF) vcanvas.h vfont.h vcpdc.h vbrush.h \
	vpen.h $(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcbtncmd.o:	vcbtncmd$(SSUF) vcbtncmd.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vchkboxc.o:	vchkboxc$(SSUF) vchkboxc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vclabelc.o:	vclabelc$(SSUF) vclabelc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcmd.o:	vcmd$(SSUF) vcmd.h $(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcmdpane.o:	vcmdpane$(SSUF) vcmdpane.h $(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcmdwin.o:	vcmdwin$(SSUF) $(BASEDEP) vwindow.h vpane.h vcmdwin.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcmdprnt.o:	vcmdprnt$(SSUF) $(BASEDEP) vcmdprnt.h $(CMDS)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcomboc.o:	vcomboc$(SSUF) vcomboc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcolor.o:	vcolor$(SSUF) vcolor.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vdebug.o:	vdebug$(SSUF) vdebug.h $(BASEDEP) vcmdprnt.h vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vdialog.o:	vdialog$(SSUF) vdialog.h $(BASEDEP) vcmdprnt.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vcpdc.o:	vcpdc$(SSUF) vdc.h vcpdc.h vpen.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vpsdc.o:	vpsdc$(SSUF) vdc.h vpsdc.h vprinter.h vpsprntr.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vfilesel.o:	vfilesel$(SSUF) vfilesel.h $(BASEDEP) vcmdprnt.h \
	vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vfinddlg.o:	vfinddlg.cpp vfinddlg.h $(BASEDEP) vcmdprnt.h \
	vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vfontsel.o:	vfontsel$(SSUF) vfontsel.h vfont.h $(BASEDEP) vcmdprnt.h \
	vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vfont.o:	vfont$(SSUF) vfont.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vframec.o:	vframec$(SSUF) vframec.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vicon.o:	vicon$(SSUF) vicon.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vlabelc.o:	vlabelc$(SSUF) vlabelc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vlistc.o:	vlistc$(SSUF) vlistc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vmemdc.o:	vmemdc$(SSUF) vmemdc.h vdc.h vpen.h vpen.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vmenu.o:	vmenu$(SSUF) vmenu.h $(BASEDEP) $(PANEDEP) vcmdwin.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vmodald.o:	vmodald$(SSUF) vmodald.h vdialog.h \
	$(BASEDEP) vcmdprnt.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vnotice.o:	vnotice$(SSUF) vnotice.h $(BASEDEP) vcmdprnt.h \
	vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vpen.o:	vpen$(SSUF) vpen.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vprogrsc.o:	vprogrsc$(SSUF) vprogrsc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vpsprntr.o:	vpsprntr$(SSUF) vpsprntr.h vprinter.h $(BASEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vradioc.o:	vradioc$(SSUF) vradioc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vsliderc.o:	vsliderc$(SSUF) vsliderc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vreply.o:	vreply$(SSUF) vreply.h $(BASEDEP) vcmdprnt.h vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vspinc.o:	vspinc$(SSUF) vspinc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vstatusp.o:	vstatusp$(SSUF) vstatusp.h $(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vtextc.o:	vtextc$(SSUF) vtextc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vtextcnv.o:	vtextcnv$(SSUF) vtextcnv.h vcanvas.h vcpdc.h \
	$(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vtexted.o:	vtexted.cpp vtexted.h vtextcnv.h vcanvas.h vcpdc.h \
	$(BASEDEP) $(PANEDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vtextinc.o:	vtextinc$(SSUF) vtextinc.h $(CMDDEP)
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vthislst.o:	vthislst$(SSUF) vthislst.h vwin32.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vtimer.o:	vtimer$(SSUF) vtimer.h vapp.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vutil.o:	vutil$(SSUF) vutil.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vwindc.o:	vwindc$(SSUF) $(BASEDEP) vwindc.h vmemdc.h vcanvas.h vicon.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vwindow.o:	vwindow$(SSUF) $(BASEDEP) vwindow.h vpane.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vwinprdc.o:	vwinprdc$(SSUF) $(BASEDEP) vwinprdc.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vwinprtr.o:	vwinprtr$(SSUF) $(BASEDEP) vwinprtr.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

$(oDir)/vynreply.o:	vynreply$(SSUF) vynreply.h $(BASEDEP) vcmdprnt.h vmodald.h
	$(CXX) -c $(CFLAGSLIB) -o $@ $<

--------------------------------------------------------------------

Wai WONG             
Department of Computing Studies,
Hong Kong Baptist University, Kowloon Tong, Hong Kong                       
Tel. No. +852 2339 7082 E-mail: [email-masked]
Fax No.  +852 2339 7892 WWW: http://www.comp.hkbu.edu.hk/~wwong/
===================================================================