Hi, I'm a newbie in Mac programming, used to work on ubuntu. Below is a makefile which works in Ubuntu, but when i run it in Mac via terminal it gives error. Can anyone tell me where to change so that i can run it without problems?
Error code is: "ar : creating archive libbg.a
ranlib: warning for library: libbg.a the table of contents is empty (no object file members in the library define global symbols)"
Thanks in advance for any help!
Original Code for Ubuntu is here:
Error code is: "ar : creating archive libbg.a
ranlib: warning for library: libbg.a the table of contents is empty (no object file members in the library define global symbols)"
Thanks in advance for any help!
Original Code for Ubuntu is here:
Code:
#
# Makefile for the bgcpp-Library
#
# +------------------------------------------------------------------+
# | Modify also the file sysdef.h depending on the target machine ! |
# +------------------------------------------------------------------+
# Uncomment the following definitions for OS/2 (see also below) :
# CC = gcc
# CLIBFLAGS = -O -c -Wall -frepo -fhandle-exceptions -s
# CFLAGS = -Wall -fhandle-exceptions -lbgcpp -lm -lstdcpp -s
# H_PATH = \home\bg\lib\
# Uncomment the following definitions for Linux (see also below):
CC = gcc
CLIBFLAGS = -I../../lib -O -c -Wall -s
CFLAGS = -I../../lib -L../../lib -Wall -lbg -lm -lstdc++ -s
PLOTFLAGS = -L/usr/X11/lib -lplotter -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
H_PATH = ../../lib/
BG_OBJ = bgcolor.o \
bgdata.o \
bgliberr.o \
bgstring.o \
centmoments.o\
centsums.o \
deuteronnmr.o\
difutil.o \
fallible.o \
fft.o \
files.o \
fresnel.o \
geometry.o \
getkey.o \
histogr.o \
ifparser.o \
inputbuf.o \
mathutil.o \
nmrutil.o \
outbuf.o \
physutil.o \
randgaus.o \
randgen.o \
solve.o \
strfunc.o \
tgapict.o \
unitcell.o \
%.o: %.cc
$(CC) $(CLIBFLAGS) -o $@ $<
bgaxis.o: bgaxis.cc $(H_PATH)bggraphics.h
bgcolor.o: bgcolor.cc $(H_PATH)bggraphics.h
bgdata.o: bgdata.cc $(H_PATH)bgdata.h
bgliberr.o: bgliberr.cc $(H_PATH)bgliberr.h
bgplotter.o: bgplotter.cc $(H_PATH)bggraphics.h
bgstring.o: bgstring.cc $(H_PATH)bgstring.h
centmoments.o: centmoments.cc $(H_PATH)stochast.h
centsums.o: centsums.cc $(H_PATH)stochast.h
deuteronnmr.o: deuteronnmr.cc $(H_PATH)nmrutil.h
difutil.o: difutil.cc $(H_PATH)difutil.h
fallible.o: fallible.cc $(H_PATH)fallible.h
files.o: files.cc $(H_PATH)bglib.h
fft.o: fft.cc $(H_PATH)fft.h
fresnel.o: fresnel.cc $(H_PATH)mathutil.h
geometry.o: geometry.cc $(H_PATH)geometry.h
getkey.o: getkey.cc $(H_PATH)bglib.h
histogr.o: histogr.cc $(H_PATH)stochast.h
ifparser.o: ifparser.cc $(H_PATH)iobuffer.h
inputbuf.o: inputbuf.cc $(H_PATH)iobuffer.h
mathutil.o: mathutil.cc $(H_PATH)mathutil.h
nmrutil.o: nmrutil.cc $(H_PATH)nmrutil.h
outbuf.o: outbuf.cc $(H_PATH)iobuffer.h
physutil.o: physutil.cc $(H_PATH)physutil.h
randgaus.o: randgaus.cc $(H_PATH)stochast.h
randgen.o: randgen.cc $(H_PATH)stochast.h
solve.o: solve.cc $(H_PATH)mathutil.h
strfunc.o: strfunc.cc $(H_PATH)bglib.h
tgapict.o: tgapict.cc $(H_PATH)tgapict.h
unitcell.o: unitcell.cc $(H_PATH)simulation.h
# Uncomment the following for OS/2
#
# bgcpp: $(BGCPP_OBJ)
# @ar r bgcpp.a $(BGCPP_OBJ)
# @ar s bgcpp.a
# @copy bgcpp.a \home\bg\lib > NUL
#
#clean:
# @del *.o > NUL
# Uncomment the following for Linux
libbg: $(BG_OBJ)
@rm -f libbg.a
@ar qv libbg.a $(BG_OBJ) > /dev/null
@ranlib libbg.a
@cp libbg.a $(H_PATH)libbg.a
bglib: libbg
clean:
@rm -f *~
@rm -f *.o
@rm -f libbg.a
@rm -f a.out
testlib: $(BG_OBJ) testlib.cc
$(CC) testlib.cc -o testlib $(PLOTFLAGS) $(CFLAGS)
all: libbg testlib
Last edited: