Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > c2557e540b386341fb15f50f49c32995 > files > 2

ppp-2.4.5-15.mga3.src.rpm

 # -*- makefile -*-
 #******************************************************************************
 #
 # Guillaume Cottenceau (gc@mandriva.com)
 #
 # Copyright 2000 Mandriva
 #
 # This software may be freely redistributed under the terms of the GNU
 # public license.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 #*****************************************************************************

ARCH := $(patsubst i%86,i386,$(shell uname -m))
ARCH := $(patsubst sparc%,sparc,$(ARCH))
ARCH := $(patsubst arm%,arm,$(ARCH))

# DEBUG = 1

 #- default frontend is newt (honoured by main Makefile whenever possible)
ifdef DEBUG
F = STDIO
else
F = NEWT
endif

# diet libc syscalls are broken on mips
ifneq (mips, $(ARCH))
# diet libc eabi support is mostly broken
ifneq (arm, $(ARCH))
DIET = $(shell test -x /usr/bin/diet && echo diet)
endif
endif


ifeq ($(DIET), diet)
 #- default lib is dietlibc (honoured by main Makefile whenever possible)
L = DIETLIBC
else
L = GLIBC
endif

ifdef DEBUG
OPTFLAGS = -g
else
OPTFLAGS = -Os
endif

#- flags used by all stuff
CFLAGS = $(OPTFLAGS) -pipe -Wall -fomit-frame-pointer -fno-strict-aliasing

ifneq (ppc, $(ARCH))
ifneq (sparc, $(ARCH))
#CFLAGS += -Werror
endif
endif

DIETLIBC_INCLUDES = -I/usr/lib/dietlibc/include -I.
DIETLIBC_LIBC = /usr/lib/dietlibc/lib-$(ARCH)/libcompat.a
GLIBC_INCLUDES = -I.
INCLUDES = $($(L)_INCLUDES)

GLIBC_LDFLAGS = -static
LDFLAGS = $($(L)_LDFLAGS)

STAGE1_LIBC = $($(L)_LIBC)

ifdef DEBUG
STRIPCMD = echo not stripping
else
STRIPCMD = strip -R .note -R .comment
endif

 #******************************************************************************
 #
 # Guillaume Cottenceau (gc@mandriva.com)
 #
 # Copyright 2000 Mandriva
 #
 # This software may be freely redistributed under the terms of the GNU
 # public license.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 #*****************************************************************************


TARGETS = pppd

BINTARGET = ../../pppd


all: $(TARGETS)

clean:
	rm -f *.o *.a $(BINTARGET) pppd

FLAGS = -Wall -Wno-deprecated-declarations -Os -fomit-frame-pointer -DDO_BSD_COMPRESS=0 -D_linux_=1 -DHAVE_MMAP -DNO_DRAND48 -D_BSD_SOURCE -D_GNU_SOURCE
# (blino) for gcc-4.1.1, dereferencing type-punned pointer will break strict-aliasing rules, in options.c:711
FLAGS += -fno-strict-aliasing

INCS = -I../include -I.

ifeq (GLIBC, $(L))
LIBS = -static -lcrypt -lutil
endif


OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o chap-md5.o md5.o ccp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tdb.o tty.o session.o ecp.o spinlock.o eap.o


pppd: $(OBJS)
	$(DIET) gcc -o $@ $^ $(LIBS)
	$(STRIPCMD) $@
	cp -f $@ $(BINTARGET)

$(OBJS): %.o: %.c
	$(DIET) gcc $(FLAGS) $(INCS) $(INCLUDES) -c $< -o $@