Linux MakeFile


[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]

Posted by Adamk on April 11, 2006 at 12:08:31:

In the linux makefile it was missing some things...
such as it didnt move hawklib.h or hawkthreads.h into the include directory, and it didnt make NL.so.1.7 or NL.so.1
or NL.so ( i dont know if other people need these but on my machine i did (gcc 3.4.4 FC3))

So i changed the makefile.linux and here it is
(can't upload attachments so i had to copy and paste)

[code]
CC = gcc
AR = ar cru
RANLIB = ranlib
MAJOR_VERSION = 1
MINOR_VERSION = 7
PATCH_LEVEL = 0
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
LIBDIR = /usr/local/lib
INCDIR = /usr/local/include
INCLUDE = -I../include
OUTPUT = libNL.so.$(VERSION)
LIBNAME = NL
STATIC = libNL.a
OPTFLAGS = -funroll-all-loops -ffast-math -fomit-frame-pointer -O2 -D_GNU_SOURCE -D_REENTRANT
CFLAGS = -Wall -fPIC $(INCLUDE) $(OPTFLAGS)
LIBFLAGS = -shared -Wl,-soname,NL.so.$(MAJOR_VERSION).$(MINOR_VERSION) -rdynamic -lpthread
OBJECTS = crc.o errorstr.o nl.o sock.o group.o loopback.o err.o hthread.o htmutex.o htcondition.o nltime.o

all: $(OBJECTS)
$(CC) -o $(OUTPUT) $(OBJECTS) $(LIBFLAGS) $(CFLAGS)
$(AR) $(STATIC) $(OBJECTS)
$(RANLIB) $(STATIC)

nl.o : nlinternal.h nl.c
sock.o : nlinternal.h sock.h sock.c
errorstr.o : nlinternal.h errorstr.c
crc.o : ../include/nl.h crc.c
group.o : nlinternal.h group.c
loopback.o : nlinternal.h loopback.h loopback.c
err.o : nlinternal.h err.c
hthread.o : htinternal.h hthread.c
htmutex.o : htinternal.h htmutex.c
htcondition.0 : htinternal.h htcondition.c
nltime.o : nlinternal.h nltime.c
ipx.o: nlinternal.h sock.h ipx.c

install:
cp $(OUTPUT) $(LIBDIR)
cp $(STATIC) $(LIBDIR)
chmod 755 $(LIBDIR)/$(OUTPUT)
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION)
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/$(LIBNAME).so
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/$(LIBNAME).so.$(MAJOR_VERSION)
cp ../include/nl.h $(INCDIR)/nl.h
cp ../include/hawklib.h $(INCDIR)/hawklib.h
cp ../include/hawkthreads.h $(INCDIR)/hawkthreads.h
chmod 644 $(INCDIR)/nl.h
chmod 644 $(INCDIR)/hawklib.h
chmod 644 $(INCDIR)/hawkthreads.h
@echo ""
@echo "*************************************************"
@echo "* Installed HawkNL. *"
@echo "* Remember to run /sbin/ldconfig before using *"
@echo "* the library, you may also want to check that *"
@echo "* $(LIBDIR) is included in /etc/ld.so.conf *"
@echo "* You must be root to run ldconfig. *"
@echo "*************************************************"

uninstall:
rm -f $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION)
rm -f $(LIBDIR)/lib$(LIBNAME).so
rm -f $(LIBDIR)/$(STATIC)
rm -f $(INCDIR)/nl.h
rm -f $(LIBDIR)/$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
rm -f $(LIBDIR)/$(LIBNAME).so.$(MAJOR_VERSION)
rm -f $(LIBDIR)/$(LIBNAME).so

.PHONY : clean
clean:
rm $(OBJECTS) $(OUTPUT) $(STATIC)
[/code]


Follow Ups:


Post a Followup

Name:
E-Mail:

Subject:

Comments:



[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]