--On June 24, 2002 08:28:33 AM "Mike H. Miller" <[EMAIL PROTECTED]>:
My real problem is that I want to be able to create loadable
modules-- does anyone have a Makefile to do that?
Hi Mike,
I've attached a copy of the makefile I am using with Linux 7.1 and 7.3.
There are 3 loadable modules. Some of these link to subroutines sitting in
other directories; let me know if you have a problem removing that stuff.
Instead of the default name used by the distribution, I use "modules2dx"
for the name of the subroutine that tells DX about the new modules.
In addition, I give the shared object the ".so" extension since that seems
the best way to identify it.
Hollor if you have questions!
Kent
- - -
Kent Eschenberg [EMAIL PROTECTED] (412)268-6829
Scientific Visualization Specialist
Pittsburgh Supercomputing Center, CMU, Pittsburgh, PA
--- snip --- snip --- snip --- snip --- snip --- snip --- snip ---
########################################################################
################ ################
################ Compile DX Modules ################
################ ################
########################################################################
#
# Purpose
# Compile several OpenDX modules.
# Original
# Author: Kent Eschenberg [EMAIL PROTECTED]
# Organization: Pittsburgh Supercomputing Center, CMU
# Date: 2002/1/29 10:41
# Current
# $Source: /home/eschenbe/makefile,v $
# $Author: eschenbe $
# $Revision: 1.3 $
# $Date: 2002/05/29 21:36:26 $
####
#### Directories outside this application
####
DXBASE = /usr/local/dx
HOME = /home/eschenbe
EYE = $(HOME)/include
SEA = $(HOME)/src
OH = $(HOME)/lib
BEN = $(HOME)/bin
####
#### Packages outside this application
####
MLIBH = $(EYE)/MfixReader.h
MLIBC = $(SEA)/MfixReader.c
MLIBO = $(OH)/MfixReader.o
KLIBH = $(EYE)/kLib.h
KLIBC = $(SEA)/kLib.c
KLIBO = $(OH)/kLib.o
BLIBH = $(EYE)/bio.h
BLIBC = $(SEA)/libbio.c
BLIBO = $(OH)/libbio.o
####
#### This application
####
MDF = xxxx.mdf
READC = xxxx2dx.c
READO = xxxx2dx.o
ANODEC = cell2anode.c
ANODEO = cell2anode.o
CNODEC = cell2cnode.c
CNODEO = cell2cnode.o
USRC = modules2dx.c
USRO = modules2dx.o
####
#### Main target
####
#PARTS = $(READO) $(ANODEO) $(CNODEO) $(MLIBO) $(KLIBO) $(BLIBO) $(USRO)
PARTS = $(READO) $(ANODEO) $(MLIBO) $(KLIBO) $(BLIBO) $(USRO)
WHOLE = mavis.so
####
#### Compile and link options
####
DEBUG = -g
#DEBUG = -O -Wuninitialized
WARN1 = -W -Wcomment -Wformat -Wimplicit -Wparentheses -Wreturn-type
-Wswitch
WARN2 = -Wunused -Wsign-compare -Waggregate-return
WARN3 = -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls
WARN4 = -Wnested-externs -Wlong-long
INCDIR = -I. -I $(EYE) -I/$(DXBASE)/include
CCFLAGS = -c $(DEBUG) $(WARN1) $(WARN2) $(WARN3) $(WARN4)
ITCHES = $(MLIBH) $(KLIBH) $(BLIBH)
LDFLAGS = -shared -e DXEntry
LIBD = -L$(DXBASE)/lib_linux -L/usr/X11R6/lib
LIBS = -lDX -lGL -ll -lX11 -lm -lm -lc
####
#### Primary dependency
####
WHOLE: $(PARTS)
cc -o $(WHOLE) $(LDFLAGS) $(PARTS) $(LIBD) $(LIBS)
####
#### This application
####
$(READO): $(READC) $(ITCHES)
cc $(CCFLAGS) $(INCDIR) $(READC)
$(ANODEO): $(ANODEC) $(ITCHES)
cc $(CCFLAGS) $(INCDIR) $(ANODEC)
$(CNODEO): $(CNODEC) $(ITCHES)
cc $(CCFLAGS) $(INCDIR) $(CNODEC)
$(USRO): $(USRC)
cc $(CCFLAGS) $(INCDIR) $(USRC)
$(USRC): $(MDF)
$(DXBASE)/bin/mdf2c -m $(MDF) > $(USRC)
####
#### Support libraries
####
$(MLIBO): $(MLIBC) $(MLIBH)
cc $(CCFLAGS) -o $(MLIBO) $(INCDIR) $(MLIBC)
$(KLIBO): $(KLIBC) $(KLIBH)
cc $(CCFLAGS) -o $(KLIBO) $(INCDIR) $(KLIBC)
$(BLIBO): $(BLIBC) $(BLIBH)
cc $(CCFLAGS) -o $(BLIBO) $(INCDIR) $(BLIBC)
########################### End of makefile ########################