summaryrefslogblamecommitdiffstats
path: root/src/Makefile
blob: 0634a7709ccca3cfa64a3533f4c9347eaaeb15ad (plain) (tree)
1
2
3
4
5
6
7
8
9

                  

                  
          
      
 
                      
 
                                                         
                                                                                                                       
 

                                                                                                                            
 

                                                                    
 
       
                                                                                                          
 
       
                        










                                                                                                               
 

                                           
 

                                           
 





                                                   





                                                  





                                                        


                                                       


                                                     

                                                 
 


                                       


                                                
 

                                                                                                     



                                                                                                








                                                                                                                                     




                                                                                                                           
 


                                                                                                                  


                                                                                                 




                                                                                                                         
 




                                                                                                                          
 
       
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

       
                                                                                                                    

       
                    

                                                                   
                                                            

           
                                                                        





                                                                  
 
       
                                        
                                                                            
                                                      
                                                    

 
 
CONFIG:=GENERIC.MP
ARCH:=amd64
ROOT!=id -u
.if (${ROOT} != 0)
DOAS:=doas
.endif

build: kernel ifconfig

/usr/src/sbin/ifconfig/ifconfig.c: patches/ifconfig.patch
	patch -uN /usr/src/sbin/ifconfig/ifconfig.c < patches/ifconfig.patch || touch /usr/src/sbin/ifconfig/ifconfig.c

/usr/src/sbin/ifconfig/Makefile: patches/ifconfig_Makefile.patch
	patch -uN /usr/src/sbin/ifconfig/Makefile < patches/ifconfig_Makefile.patch || touch /usr/src/sbin/ifconfig/Makefile

/usr/include/net/if_wg.h: /usr/src/sys/net/if_wg.h
	${DOAS} cp /usr/src/sys/net/if_wg.h /usr/include/net/if_wg.h

.PHONY:
patch_ifconfig: /usr/src/sbin/ifconfig/ifconfig.c /usr/src/sbin/ifconfig/Makefile /usr/include/net/if_wg.h

.PHONY:
ifconfig: patch_ifconfig
	make -C /usr/src/sbin/ifconfig

/usr/src/sbin/sysctl/sysctl.c: patches/sysctl.c.patch
	patch -uN /usr/src/sbin/sysctl/sysctl.c < patches/sysctl.c.patch || touch /usr/src/sbin/sysctl/sysctl.c

.PHONY:
patch_sysctl: /usr/src/sbin/sysctl/sysctl.c

.PHONY:
sysctl: patch_sysctl
	make -C /usr/src/sbin/sysctl

/usr/src/sys/net/if_wg.c: if_wg.c
	cp if_wg.c /usr/src/sys/net/if_wg.c

/usr/src/sys/net/if_wg.h: if_wg.h
	cp if_wg.h /usr/src/sys/net/if_wg.h

/usr/src/sys/net/wireguard.c: wireguard.c
	cp wireguard.c /usr/src/sys/net/wireguard.c

/usr/src/sys/net/wireguard.h: wireguard.h
	cp wireguard.h /usr/src/sys/net/wireguard.h

/usr/src/sys/crypto/blake2s.c: blake2s.c
	cp blake2s.c /usr/src/sys/crypto/blake2s.c

/usr/src/sys/crypto/blake2s.h: blake2s.h
	cp blake2s.h /usr/src/sys/crypto/blake2s.h

/usr/src/sys/crypto/curve25519.c: curve25519.c
	cp curve25519.c /usr/src/sys/crypto/curve25519.c

/usr/src/sys/crypto/curve25519.h: curve25519.h
	cp curve25519.h /usr/src/sys/crypto/curve25519.h

/usr/src/sys/sys/bloombucket.h: bloombucket.h
	cp bloombucket.h /usr/src/sys/sys/bloombucket.h

/usr/src/sys/sys/antireplay.h: antireplay.h
	cp antireplay.h /usr/src/sys/sys/antireplay.h

/usr/src/sys/sys/fixedmap.h: fixedmap.h
	cp fixedmap.h /usr/src/sys/sys/fixedmap.h

/usr/src/sys/sys/mpq.h: mpq.h
	cp mpq.h /usr/src/sys/sys/mpq.h

/usr/src/sys/kern/kern_wg.c: kern_wg.c
	cp kern_wg.c /usr/src/sys/kern/kern_wg.c


/usr/src/sys/conf/GENERIC: patches/CONFIG.patch
	patch -uN /usr/src/sys/conf/GENERIC < patches/CONFIG.patch || touch /usr/src/sys/conf/GENERIC

/usr/src/sys/conf/files: patches/files.patch
	patch -uN /usr/src/sys/conf/files < patches/files.patch || touch /usr/src/sys/conf/files

/usr/src/sys/crypto/chacha_private.h: patches/chacha_private.h.patch
	patch -uN /usr/src/sys/crypto/chacha_private.h < patches/chacha_private.h.patch || touch /usr/src/sys/crypto/chacha_private.h

/usr/src/sys/crypto/chachapoly.h: patches/chachapoly.h.patch
	patch -uN /usr/src/sys/crypto/chachapoly.h < patches/chachapoly.h.patch || touch /usr/src/sys/crypto/chachapoly.h

/usr/src/sys/crypto/chachapoly.c: patches/chachapoly.c.patch
	patch -uN /usr/src/sys/crypto/chachapoly.c < patches/chachapoly.c.patch || touch /usr/src/sys/crypto/chachapoly.c

/usr/src/sys/netinet/in_pcb.h: patches/in_pcb.h.patch
	patch -uN /usr/src/sys/netinet/in_pcb.h < patches/in_pcb.h.patch || touch /usr/src/sys/netinet/in_pcb.h

/usr/src/sys/netinet/udp_usrreq.c: patches/udp_usrreq.c.patch
	patch -uN /usr/src/sys/netinet/udp_usrreq.c < patches/udp_usrreq.c.patch || touch /usr/src/sys/netinet/udp_usrreq.c

/usr/src/sys/kern/uipc_mbuf.c: patches/uipc_mbuf.c.patch
	patch -uN /usr/src/sys/kern/uipc_mbuf.c < patches/uipc_mbuf.c.patch || touch /usr/src/sys/kern/uipc_mbuf.c

/usr/src/sys/sys/mbuf.h: patches/mbuf.h.patch
	patch -uN /usr/src/sys/sys/mbuf.h < patches/mbuf.h.patch || touch /usr/src/sys/sys/mbuf.h

/usr/src/usr.bin/kdump/mkioctls: patches/mkioctls.patch
	patch -uN /usr/src/usr.bin/kdump/mkioctls < patches/mkioctls.patch || touch /usr/src/usr.bin/kdump/mkioctls

/usr/src/usr.bin/kdump/Makefile: patches/kdump_Makefile.patch
	patch -uN /usr/src/usr.bin/kdump/Makefile < patches/kdump_Makefile.patch || touch /usr/src/usr.bin/kdump/Makefile

/usr/src/distrib/sets/lists/comp/mi: patches/comp_mi.patch
	patch -uN /usr/src/distrib/sets/lists/comp/mi < patches/comp_mi.patch || touch /usr/src/distrib/sets/lists/comp/mi

/usr/src/distrib/sets/lists/man/mi: patches/man_mi.patch
	patch -uN /usr/src/distrib/sets/lists/man/mi < patches/man_mi.patch || touch /usr/src/distrib/sets/lists/man/mi

.PHONY:
patch_kernel: /usr/src/sys/net/wireguard.c /usr/src/sys/net/wireguard.h /usr/src/sys/crypto/blake2s.c /usr/src/sys/crypto/blake2s.h /usr/src/sys/crypto/curve25519.c /usr/src/sys/crypto/curve25519.h /usr/src/sys/crypto/chacha_private.h /usr/src/sys/crypto/chachapoly.h /usr/src/sys/crypto/chachapoly.c /usr/src/sys/conf/files /usr/src/sys/conf/GENERIC /usr/src/sys/netinet/in_pcb.h /usr/src/sys/netinet/udp_usrreq.c /usr/src/sys/net/if_wg.c /usr/src/sys/net/if_wg.h /usr/src/sys/sys/bloombucket.h /usr/src/sys/sys/fixedmap.h /usr/src/sys/kern/uipc_mbuf.c /usr/src/sys/sys/mpq.h /usr/src/sys/sys/antireplay.h /usr/src/sys/kern/kern_wg.c

.PHONY:
patch_userspace: /usr/src/usr.bin/kdump/mkioctls /usr/src/usr.bin/kdump/Makefile /usr/src/distrib/sets/lists/comp/mi

.PHONY:
kernel: patch_kernel
	make -C /usr/src/sys/arch/${ARCH}/compile/$(CONFIG)/ obj
	make -C /usr/src/sys/arch/${ARCH}/compile/$(CONFIG)/ config
	make -C /usr/src/sys/arch/${ARCH}/compile/$(CONFIG)/
.PHONY:
installgdb:
	doas cp /usr/obj/sys/arch/${ARCH}/compile/$(CONFIG)/bsd.gdb /bsd

.PHONY:
clean:
	make -C /usr/src/sys/arch/${ARCH}/compile/$(CONFIG)/ clean
	make -C /usr/src/sbin/ifconfig clean


.PHONY:
install: kernel ifconfig patch_userspace
	${DOAS} make -C /usr/src/sys/arch/${ARCH}/compile/$(CONFIG)/ install
	${DOAS} make -C /usr/src/sbin/ifconfig install
	${DOAS} make -C /usr/src/sbin/sysctl install