################################################################################ # kissdx multi OS Makefile # By SR. 2007-11-30 ################################################################################ ################################################################################ # Operating system # Uncomment for one of the desired OS (Execpt FreeBSD which will be defined by # the master makefile) # Understand Linux to mean any distro, including Optware targets and Cygwin. ################################################################################ Linux= defined #Macosx= defined #FreeBSD= defined ################################################################################ # Build environment # Uncomment for specifics of the target environment # Optware Define when building on an Optware platform # IconvExternal Define when libiconv is not built in and must be linked ################################################################################ #Optware= defined #IconvExternal= defined ################################################################################ # Generic settings # # In some UNIX systems build options that affect all ports can be set globally. # this makefile should not override the existing value. ################################################################################ CC?= gcc # compiler directives (defines) # Sendfile: # -DUSE_INTERNAL_SENDFILE (less performance) # if you cannot use the sendfile syscall on your target platform with # 64-bit file access. Required for Unslung 5.5 on NSLU2. # -DUSE_INTERNAL_SENDFILE_MMAP (better performance) # Use along with -DUSE_INTERNAL_SENDFILE if your target platform supports # memory mapped files with 64-bit file access and you want to use it. # Won't work with >2GB files on Unslung 5.5 on NSLU2 due to bug in libc. # DVD support: # -DUSE_DVDNAV # Use this to compile in support for libdvdnav usage (experimental) CFLAGS+= -DUSE_INTERNAL_SENDFILE # Support for lage file sizes >2Gb CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS+= -D_GNU_SOURCE # Compile options CFLAGS+= -Wall -Wstrict-prototypes -std=gnu99 -O2 #since ubutnu.intrepid : new warning appears : https://wiki.ubuntu.com/CompilerFlags CFLAGS+= -U_FORTIFY_SOURCE -Wno-format-security # Libraries: dvdread, jpeg, math LIBS+= -ldvdread LIBS+= -ljpeg LIBS+= -lm # This adds libdvdnav linkage if -DUSE_DVDNAV was specified above ifeq ($(filter -DUSE_DVDNAV,$(CFLAGS)),-DUSE_DVDNAV) LIBS+= -ldvdnav endif # Default library locations CFLAGS+= -I/usr/include/ LDFLAGS+= -L/usr/lib ################################################################################ # Operating system dependent settings ################################################################################ # Optware environment ############################################## ifdef OPTWARE_TARGET Optware= defined endif ifdef Optware CFLAGS+= -I/opt/include LDFLAGS+= -L/opt/lib endif # MacOSX environement ############################################## # Options: -DLinux & -DFreeBSD : both are supported on OSX.10.5 ifdef Macosx CFLAGS+= -fnested-functions CFLAGS+= -I/opt/local/include/ LIBS+= -L/opt/local/lib/ IconvExternal= defined #CFLAGS+= -DLinux CFLAGS+= -DFreeBSD endif # FreeBSD environement ############################################## # FreeBSD, LOCALBASE, CC CFLAGS, LDFLAGS are predefined in ports Makefile ifdef FreeBSD # When not used in connection with the portssystem these variables needs to be set ifndef LOCALBASE LOCALBASE= /usr/local IconvExternal= defined endif CFLAGS+= -DFreeBSD CFLAGS+= -I${LOCALBASE}/include CFLAGS+= -DCONF_DIR=\"${LOCALBASE}/etc\" LDFLAGS+= -L${LOCALBASE}/lib Linux= endif # Linux any distro, including Optware targets and Cygwin. ############ ifdef Linux CC= gcc CFLAGS+= -DLinux # Install settings create-install-target= defined endif # Some systems have libiconv built in ifdef IconvExternal LIBS+= -liconv endif ################################################################################ ################################################################################ # Make a list of object files as targets for compilation ################################################################################ OBJS= kissdx.o connection.o sendfile.o dvdread.o playlist.o jpeg.o piccache.o OBJS+= utils.o config.o backtoback.o cmdclient.o cmdserver.o OBJS+= gdstuff/gdstuff.o gdstuff/gd.o gdstuff/gdfontg.o gdstuff/gd_jpeg.o OBJS+= gdstuff/gdhelpers.o gdstuff/gd_io_dp.o gdstuff/gd_io.o gdstuff/gd_security.o ################################################################################ # Compile and link rules # # Build in macros: #$@ The file name of the target. #$< The name of the first dependency. #$* The part of a filename which matched a suffix rule. #$? The names of all the dependencies newer than the target separated by spaces. #$^ The names of all the dependencies separated by spaces, but with duplicate # names removed. #$+ The names of all the dependencies separated by spaces with duplicate names # included and in the same order as in the rule. ################################################################################ .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< .o: $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) # Do all the compiling and linking kissdx: $(OBJS) all: kissdx ################################################################################ # Linux install rules ################################################################################ ifndef FreeBSD ifdef create-install-target include Linux/Makefile.in endif endif