2 # Makefile for 64-bit STREAMS modules for Solaris 2 on x64 with gcc.
4 # $Id: Makefile.sol2gcc-64x,v 1.1 2005/06/26 23:53:17 carlsonj Exp $
9 # gcc flags for LP64 compilation / linkage
10 COPTS += -finline -fno-inline-functions -fno-builtin -fno-asm \
11 -nodefaultlibs -D__sun -m64 -mtune=opteron -Ui386 \
12 -U__i386 -fno-strict-aliasing -fno-unit-at-a-time \
13 -fno-optimize-sibling-calls -O2 -D_ASM_INLINES \
14 -ffreestanding -mcmodel=kernel -mno-red-zone -gdwarf-2 \
15 -std=gnu89 -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL \
16 -D_ELF64 -Dsun -D__sun -D__SVR4
18 # subdirectory where 64-bit objects / binaries will be placed
21 # Name of legacy Makefile (for 32-bit binaries)
22 STD_MAKE = Makefile.sol2gcc
24 COMP_OBJS = $(LP64DIR)/ppp_comp.o $(LP64DIR)/bsd-comp.o \
25 $(LP64DIR)/deflate.o $(LP64DIR)/zlib.o $(LP64DIR)/vjcompress.o \
26 $(LP64DIR)/ppp_comp_mod.o
28 all: std_objs $(LP64DIR) ppp ppp_ahdl ppp_comp
31 $(MAKE) -f $(STD_MAKE) all
33 ppp: $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
34 $(LD) -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
35 chmod +x $(LP64DIR)/$@
37 ppp_ahdl: $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
38 $(LD) -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp_ahdlc.o \
39 $(LP64DIR)/ppp_ahdlc_mod.o
40 chmod +x $(LP64DIR)/$@
42 ppp_comp: $(COMP_OBJS)
43 $(LD) -r -o $(LP64DIR)/$@ $(COMP_OBJS)
44 chmod +x $(LP64DIR)/$@
46 $(LP64DIR)/bsd-comp.o: ../modules/bsd-comp.c
47 $(CC) $(CFLAGS) -c $? -o $@
48 $(LP64DIR)/deflate.o: ../modules/deflate.c
49 $(CC) $(CFLAGS) -c $? -o $@
50 $(LP64DIR)/ppp.o: ppp.c
51 $(CC) $(CFLAGS) -c $? -o $@
52 $(LP64DIR)/ppp_mod.o: ppp_mod.c
53 $(CC) $(CFLAGS) -c $? -o $@
54 $(LP64DIR)/ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
55 $(CC) $(CFLAGS) -c $? -o $@
56 $(LP64DIR)/ppp_ahdlc.o: ppp_ahdlc.c
57 $(CC) $(CFLAGS) -c $? -o $@
58 $(LP64DIR)/ppp_comp.o: ppp_comp.c
59 $(CC) $(CFLAGS) -c $? -o $@
60 $(LP64DIR)/ppp_comp_mod.o: ppp_comp_mod.c
61 $(CC) $(CFLAGS) -c $? -o $@
62 $(LP64DIR)/vjcompress.o: ../modules/vjcompress.c
63 $(CC) $(CFLAGS) -c $? -o $@
64 $(LP64DIR)/zlib.o: ../common/zlib.c
65 $(CC) $(CFLAGS) -c $? -o $@
71 /usr/sbin/modunload -i 0
72 cp ppp ppp.conf /kernel/drv
73 cp ppp_comp ppp_ahdl /kernel/strmod
74 cp $(LP64DIR)/ppp /kernel/drv/$(LP64DIR)
75 cp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl /kernel/strmod/$(LP64DIR)
76 if grep clone:ppp /etc/minor_perm; then :; else \
77 echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
78 /usr/sbin/rem_drv ppp 2>/dev/null || true
79 /usr/sbin/modunload -i 0
82 SRCS = ppp.c ppp_mod.c ppp_ahdlc.c ppp_ahdlc_mod.c \
83 ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
84 ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
93 $(MAKE) -f $(STD_MAKE) clean
94 rm -f $(LP64DIR)/ppp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl $(LP64DIR)/*.o $(LP64DIR)/*~ $(LP64DIR)/core