.EXPORT_ALL_VARIABLES: ############################################################################ # # A Generic m68k config.arch that can be included by other platforms # to reduce the number of places that need to be edited when something # common changes. If you include this file you may provide: # # CPUFLAGS - cpu specific flags to pass to the compiler # VENDOR_CFLAGS - vendor specific flags to pass to the compiler # DISABLE_XIP - set this to 1 to disable XIP code # DISABLE_SHARED_LIBS - set this to 1 to disable shared libraries # DISABLE_MOVE_RODATA - set this to 1 to disable moving rodata to text # LOPT - library optimisation flags # UOPT - user optimisation flags # # gerold boehler # ############################################################################ # # Generic settings # DISABLE_XIP := 1 ifndef CONSOLE_BAUD_RATE CONSOLE_BAUD_RATE = 19200 endif ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules)) EXTRA_MODULE_DIRS = $(ROOTDIR)/modules endif ifndef VERSIONPKG #define VERSIONPKG 1.0.0 endif ifndef VERSIONSTR VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG) endif ifndef RELFILES RELFILES = boot/boot.bin,.sgb boot/boot.elf images/imagez.bin,.sgu images/image.elf endif ifndef NFIMAGE NFIMAGE=imagez.bin endif ############################################################################ # # The makefiles need to know how to do things in different contexts # To save some pain we put it all here # # First settings we always want for all builds # # ARCH = kernel, TARGET_ARCH = uClibc MACHINE = m68k ARCH = m68knommu CROSS_COMPILE = m68k-elf- CROSS = $(CROSS_COMPILE) CC = $(CROSS_COMPILE)gcc $(CPUFLAGS) AS = $(CROSS_COMPILE)as $(CPUFLAGS) CXX = $(CROSS_COMPILE)g++ $(CPUFLAGS) AR = $(CROSS_COMPILE)ar LD = $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy RANLIB = $(CROSS_COMPILE)ranlib ELF2FLT = elf2flt STRIPTOOL = $(CROSS_COMPILE)strip STRIP = $(STRIPTOOL) UCLINUX_BUILD_SET = 0 # have we set a special config below ifndef DISABLE_SHARED_LIBS ifeq ($(CONFIG_BINFMT_SHARED_FLAT),y) BUILD_SHARED = 1 endif endif ############################################################################ # # General purpose lib building rules, uClibc.config uses these when # possible # ifdef UCLINUX_BUILD_LIB ifdef CONFIG_LIB_DEBUG CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g else CFLAGS := $(if $(LOPT),$(LOPT),-O2) -g -fomit-frame-pointer endif CFLAGS += $(CPUFLAGS) CFLAGS += $(VENDOR_CFLAGS) CFLAGS += -fno-builtin CFLAGS += -DEMBED ifdef BUILD_SHARED CFLAGS += -mid-shared-library else ifndef DISABLE_XIP CFLAGS += -msep-data endif endif # don't want all the CFLAGS for uClibc/Config ARCH_CFLAGS = $(CFLAGS) CFLAGS += -I$(ROOTDIR)/lib/$(CONFIG_LIBCDIR)/include -I$(ROOTDIR) CFLAGS += -Dlinux -D__linux__ -D__uClinux__ -Dunix # the following is needed for uClinux-2.4 CFLAGS += -I$(ROOTDIR)/$(LINUXDIR)/include LDFLAGS = $(CFLAGS) -Wl,-elf2flt ifndef DISABLE_MOVE_RODATA LDFLAGS += -Wl,-move-rodata endif UCLINUX_BUILD_SET=1 endif ############################################################################ # # Settings for building user apps # ifdef UCLINUX_BUILD_USER GCC_DIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./') GCC_LIB = /usr/local/m68k-elf/lib SLIBC = -lc SLIBM = -lm SLIBNET = -lnet SLIBDES = -ldes SLIBAES = -laes SLIBPCAP = -lpcap SLIBSSL = -lssl SLIBCRYPTO = -lcrypto SLIBCRYPT = -lcrypt_old SLIBPTHREAD = -lpthread SLIBSNAPGEARPP = -lsnapgear++ SLIBSNAPGEAR = -lsnapgear -llocale SLIBCONFIGDD = -lconfigdd ifdef BUILD_SHARED LIBC = -Wl,-R,$(ROOTDIR)/lib/$(LIBCDIR)/libc.gdb $(SLIBC) LIBSNAPGEAR = -Wl,-R,$(ROOTDIR)/lib/libsnapgear/libsnapgear.gdb \ $(SLIBSNAPGEAR) else LIBC = $(SLIBC) LIBSNAPGEAR = $(SLIBSNAPGEAR) endif LIBM = $(SLIBM) LIBNET = $(SLIBNET) LIBDES = $(SLIBDES) LIBAES = $(SLIBAES) LIBPCAP = $(SLIBPCAP) LIBSSL = $(SLIBSSL) LIBCRYPTO = $(SLIBCRYPTO) LIBCRYPT = $(SLIBCRYPT) LIBPTHREAD = $(SLIBPTHREAD) LIBSNAPGEARPP = $(SLIBSNAPGEARPP) LIBCONFIGDD = $(SLIBCONFIGDD) LIBGCC = -lgcc LIBIBERTY = -liberty LIBIO = -lio LIBIOSTREAM = -liostream LIBSTDCPP = -lstdc++ LDPATH = \ -L$(ROOTDIR)/lib/$(LIBCDIR)/. \ -L$(ROOTDIR)/lib/$(LIBCDIR)/lib \ -L$(ROOTDIR)/lib/libm \ -L$(ROOTDIR)/lib/libnet \ -L$(ROOTDIR)/lib/libdes \ -L$(ROOTDIR)/lib/libaes \ -L$(ROOTDIR)/lib/libpcap \ -L$(ROOTDIR)/lib/libssl \ -L$(ROOTDIR)/lib/libcrypt_old \ -L$(ROOTDIR)/lib/libsnapgear++ \ -L$(ROOTDIR)/lib/libsnapgear \ -L$(ROOTDIR)/lib/zlib INCLIBC = -I$(ROOTDIR)/lib/$(CONFIG_LIBCDIR)/include INCLIBM = -I$(ROOTDIR)/lib/libm INCNET = -I$(ROOTDIR)/lib/libnet INCDES = -I$(ROOTDIR)/freeswan/libdes INCAES = -I$(ROOTDIR)/freeswan/libcrypto/libaes INCGMP = -I$(ROOTDIR)/lib/libgmp INCPCAP = -I$(ROOTDIR)/lib/libpcap INCSSL = -I$(ROOTDIR)/lib/libssl/include INCZ = -I$(ROOTDIR)/lib/zlib INCVEND = -I$(ROOTDIR)/vendors/include INCSG = -I$(ROOTDIR)/lib/libsnapgear/include INCSGPP = -I$(ROOTDIR)/lib/libsnapgear++/include INCCRYPTOLD = -I$(ROOTDIR)/lib/libcrypt_old ifdef CONFIG_USER_DEBUG CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g else CFLAGS := $(if $(UOPT),$(UOPT),-Os) -g -fomit-frame-pointer endif CFLAGS += $(CPUFLAGS) CFLAGS += $(VENDOR_CFLAGS) CFLAGS += -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED CFLAGS += $(INCLIBC) $(INCLIBM) $(INCCRYPTOLD) CFLAGS += -I$(ROOTDIR) CFLAGS += -fno-builtin ifdef BUILD_SHARED CFLAGS += -mid-shared-library -mshared-library-id=0 else ifndef DISABLE_XIP CFLAGS += -msep-data endif endif # # the following is needed for 2.4 # CFLAGS += -I$(ROOTDIR)/$(LINUXDIR)/include CXXFLAGS = $(CFLAGS) $(INCCXX) LDFLAGS = $(CFLAGS) -Wl,-elf2flt ifndef DISABLE_MOVE_RODATA LDFLAGS += -Wl,-move-rodata endif ifdef BUILD_SHARED LDFLAGS += -Wl,-shared-lib-id,0 endif ifneq ($(LIBCDIR),libc) LDFLAGS += -nostartfiles $(ROOTDIR)/lib/$(LIBCDIR)/lib/crt0.o endif LDFLAGS += $(LDPATH) LDLIBS = $(LIBC) LDLIBS_static = $(SLIBC) CXXLIBS = $(LIBSTDCPP) $(LIBIBERTY) $(LIBC) $(LIBGCC) ifndef FLTFLAGS FLTFLAGS := endif export FLTFLAGS # for anyone still using it CONVERT = /bin/true UCLINUX_BUILD_SET=1 endif ############################################################################ # # fall through, do other config options perhaps # ifeq ($(UCLINUX_BUILD_SET),1) endif ############################################################################