lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | # |
| 2 | # Makefile for 64-bit STREAMS modules for Solaris 2. |
| 3 | # |
| 4 | # $Id: Makefile.sol2gcc-64,v 1.3 2004/11/15 00:57:54 carlsonj Exp $ |
| 5 | # |
| 6 | |
| 7 | include Makedefs.sol2 |
| 8 | |
| 9 | # gcc flags for LP64 compilation / linkage |
| 10 | COPTS += -mcpu=v9 -m64 -mcmodel=medlow -mstack-bias -fno-builtin |
| 11 | |
| 12 | # subdirectory where 64-bit objects / binaries will be placed |
| 13 | LP64DIR = sparcv9 |
| 14 | |
| 15 | # Name of legacy Makefile (for 32-bit binaries) |
| 16 | STD_MAKE = Makefile.sol2gcc |
| 17 | |
| 18 | COMP_OBJS = $(LP64DIR)/ppp_comp.o $(LP64DIR)/bsd-comp.o \ |
| 19 | $(LP64DIR)/deflate.o $(LP64DIR)/zlib.o $(LP64DIR)/vjcompress.o \ |
| 20 | $(LP64DIR)/ppp_comp_mod.o |
| 21 | |
| 22 | all: std_objs $(LP64DIR) ppp ppp_ahdl ppp_comp |
| 23 | |
| 24 | std_objs: |
| 25 | $(MAKE) -f $(STD_MAKE) all |
| 26 | |
| 27 | ppp: $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o |
| 28 | $(LD) -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o |
| 29 | chmod +x $(LP64DIR)/$@ |
| 30 | |
| 31 | ppp_ahdl: $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o |
| 32 | $(LD) -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp_ahdlc.o \ |
| 33 | $(LP64DIR)/ppp_ahdlc_mod.o |
| 34 | chmod +x $(LP64DIR)/$@ |
| 35 | |
| 36 | ppp_comp: $(COMP_OBJS) |
| 37 | $(LD) -r -o $(LP64DIR)/$@ $(COMP_OBJS) |
| 38 | chmod +x $(LP64DIR)/$@ |
| 39 | |
| 40 | $(LP64DIR)/bsd-comp.o: ../modules/bsd-comp.c |
| 41 | $(CC) $(CFLAGS) -c $? -o $@ |
| 42 | $(LP64DIR)/deflate.o: ../modules/deflate.c |
| 43 | $(CC) $(CFLAGS) -c $? -o $@ |
| 44 | $(LP64DIR)/ppp.o: ppp.c |
| 45 | $(CC) $(CFLAGS) -c $? -o $@ |
| 46 | $(LP64DIR)/ppp_mod.o: ppp_mod.c |
| 47 | $(CC) $(CFLAGS) -c $? -o $@ |
| 48 | $(LP64DIR)/ppp_ahdlc_mod.o: ppp_ahdlc_mod.c |
| 49 | $(CC) $(CFLAGS) -c $? -o $@ |
| 50 | $(LP64DIR)/ppp_ahdlc.o: ppp_ahdlc.c |
| 51 | $(CC) $(CFLAGS) -c $? -o $@ |
| 52 | $(LP64DIR)/ppp_comp.o: ppp_comp.c |
| 53 | $(CC) $(CFLAGS) -c $? -o $@ |
| 54 | $(LP64DIR)/ppp_comp_mod.o: ppp_comp_mod.c |
| 55 | $(CC) $(CFLAGS) -c $? -o $@ |
| 56 | $(LP64DIR)/vjcompress.o: ../modules/vjcompress.c |
| 57 | $(CC) $(CFLAGS) -c $? -o $@ |
| 58 | $(LP64DIR)/zlib.o: ../common/zlib.c |
| 59 | $(CC) $(CFLAGS) -c $? -o $@ |
| 60 | |
| 61 | $(LP64DIR): |
| 62 | mkdir -m 755 -p $@ |
| 63 | |
| 64 | install: |
| 65 | /usr/sbin/modunload -i 0 |
| 66 | cp ppp ppp.conf /kernel/drv |
| 67 | cp ppp_comp ppp_ahdl /kernel/strmod |
| 68 | cp $(LP64DIR)/ppp /kernel/drv/$(LP64DIR) |
| 69 | cp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl /kernel/strmod/$(LP64DIR) |
| 70 | if grep clone:ppp /etc/minor_perm; then :; else \ |
| 71 | echo clone:ppp 0644 root sys >>/etc/minor_perm; fi |
| 72 | /usr/sbin/rem_drv ppp 2>/dev/null || true |
| 73 | /usr/sbin/modunload -i 0 |
| 74 | /usr/sbin/add_drv ppp |
| 75 | |
| 76 | SRCS = ppp.c ppp_mod.c ppp_ahdlc.c ppp_ahdlc_mod.c \ |
| 77 | ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \ |
| 78 | ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c |
| 79 | |
| 80 | lint: |
| 81 | $(LINT64) $(SRCS) |
| 82 | |
| 83 | lint-32: |
| 84 | $(LINT32) $(SRCS) |
| 85 | |
| 86 | clean: |
| 87 | $(MAKE) -f $(STD_MAKE) clean |
| 88 | rm -f $(LP64DIR)/ppp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl $(LP64DIR)/*.o $(LP64DIR)/*~ $(LP64DIR)/core |