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
|
--- source/Irrlicht/Makefile.orig 2010-01-16 01:32:18.000000000 +0300
+++ source/Irrlicht/Makefile 2010-01-16 01:33:07.000000000 +0300
@@ -3,7 +3,7 @@
VERSION_RELEASE = 1
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
# Irrlicht Engine 1.6.0-SVN
-# Makefile for Linux
+# Makefile for FreeBSD
#
# To use, just run:
#
@@ -39,29 +39,26 @@
IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CZipReader.o CPakReader.o CTarReader.o CMountPointReader.o irrXML.o CAttributes.o
IRROTHEROBJ = CIrrDeviceSDL.o CIrrDeviceLinux.o CIrrDeviceConsole.o CIrrDeviceStub.o CIrrDeviceWin32.o CLogger.o COSOperator.o Irrlicht.o os.o
IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o CGUIImageList.o CGUITreeView.o
-ZLIBOBJ = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
-JPEGLIBOBJ = jpeglib/jcapimin.o jpeglib/jcapistd.o jpeglib/jccoefct.o jpeglib/jccolor.o jpeglib/jcdctmgr.o jpeglib/jchuff.o jpeglib/jcinit.o jpeglib/jcmainct.o jpeglib/jcmarker.o jpeglib/jcmaster.o jpeglib/jcomapi.o jpeglib/jcparam.o jpeglib/jcphuff.o jpeglib/jcprepct.o jpeglib/jcsample.o jpeglib/jctrans.o jpeglib/jdapimin.o jpeglib/jdapistd.o jpeglib/jdatadst.o jpeglib/jdatasrc.o jpeglib/jdcoefct.o jpeglib/jdcolor.o jpeglib/jddctmgr.o jpeglib/jdhuff.o jpeglib/jdinput.o jpeglib/jdmainct.o jpeglib/jdmarker.o jpeglib/jdmaster.o jpeglib/jdmerge.o jpeglib/jdphuff.o jpeglib/jdpostct.o jpeglib/jdsample.o jpeglib/jdtrans.o jpeglib/jerror.o jpeglib/jfdctflt.o jpeglib/jfdctfst.o jpeglib/jfdctint.o jpeglib/jidctflt.o jpeglib/jidctfst.o jpeglib/jidctint.o jpeglib/jidctred.o jpeglib/jmemmgr.o jpeglib/jmemnobs.o jpeglib/jquant1.o jpeglib/jquant2.o jpeglib/jutils.o
-LIBPNGOBJ = libpng/png.o libpng/pngerror.o libpng/pngget.o libpng/pngmem.o libpng/pngpread.o libpng/pngread.o libpng/pngrio.o libpng/pngrtran.o libpng/pngrutil.o libpng/pngset.o libpng/pngtrans.o libpng/pngwio.o libpng/pngwrite.o libpng/pngwtran.o libpng/pngwutil.o
# Next variable is for additional scene nodes etc. of customized Irrlicht versions
EXTRAOBJ =
LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \
$(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) \
- $(IRRGUIOBJ) $(ZLIBOBJ) $(JPEGLIBOBJ) $(LIBPNGOBJ) $(EXTRAOBJ)
+ $(IRRGUIOBJ) $(EXTRAOBJ)
###############
#Compiler flags
-CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng
-CPPFLAGS = $(CXXINCS) -DIRRLICHT_EXPORTS=1
+CXXINCS = -I../../include -I$(LOCALBASE)/include -I/usr/include
+CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1
CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
ifndef NDEBUG
CXXFLAGS += -g -D_DEBUG
else
-CXXFLAGS += -fexpensive-optimizations -O3
+CXXFLAGS += -fexpensive-optimizations
endif
ifdef PROFILE
CXXFLAGS += -pg
endif
-CFLAGS := -fexpensive-optimizations -O3 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES
+#CFLAGS := -fexpensive-optimizations -O3 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES
sharedlib sharedlib_osx: CXXFLAGS += -fPIC
sharedlib sharedlib_osx: CFLAGS += -fPIC
@@ -71,15 +68,15 @@
LIBSELECT=64
endif
-#Linux specific options
-staticlib sharedlib install: SYSTEM = Linux
+#FreeBSD specific options
+staticlib sharedlib install: SYSTEM = FreeBSD
STATIC_LIB = libIrrlicht.a
LIB_PATH = ../../lib/$(SYSTEM)
-INSTALL_DIR = /usr/local/lib
+INSTALL_DIR = $(PREFIX)/lib
sharedlib install: SHARED_LIB = libIrrlicht.so
staticlib sharedlib: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
-sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
-staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
+sharedlib: LDFLAGS += -L/usr/lib -L$(LOCALBASE)/lib -lGL -lXxf86vm -lpng -ljpeg
+staticlib sharedlib: CXXINCS += -I$(LOCALBASE)/include
#OSX specific options
staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX
@@ -97,20 +94,22 @@
staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
####################
-# All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into /lib/Linux
-all linux: staticlib
+# All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into /lib/FreeBSD
+all linux: staticlib sharedlib
-# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/Linux
+# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/FreeBSD
sharedlib: $(LINKOBJ)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SHARED_LIB).$(VERSION) -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
+ mkdir -p $(LIB_PATH)
cp $(SHARED_LIB).$(VERSION) $(LIB_PATH)
# Builds Irrlicht as static lib (libIrrlicht.a)
$(STATIC_LIB): $(LINKOBJ)
$(AR) rs $@ $^
-# Copies static lib into /lib/Linux
+# Copies static lib into /lib/FreeBSD
staticlib staticlib_osx: $(STATIC_LIB)
+ mkdir -p $(LIB_PATH)
cp $^ $(LIB_PATH)
# Builds Irrlicht as dll (Irrlicht.dll) into ../../bin/Win32-gcc
@@ -153,9 +152,9 @@
help:
@echo "Available targets for Irrlicht"
- @echo " sharedlib: Build shared library Irrlicht.so for Linux"
- @echo " staticlib: Build static library Irrlicht.a for Linux"
- @echo " install: Copy shared library to /usr/lib"
+ @echo " sharedlib: Build shared library Irrlicht.so for FreeBSD"
+ @echo " staticlib: Build static library Irrlicht.a for FreeBSD"
+ @echo " install: Copy shared library to $(LOCALBASE)/lib"
@echo ""
@echo " sharedlib_win32: Build shared library Irrlicht.dll for Windows"
@echo " staticlib_win32: Build static library Irrlicht.a for Windows"
|