blob: 7920acd934922995df802969aa3fd7d3226195f6 [file] [log] [blame] [raw]
CFLAGS += -D "__bounded__(a,b,c)=" -D SIZE_T_MAX=ULONG_MAX -D IPTOS_DSCP_AF11=0x28 -D IPTOS_DSCP_AF12=0x30 -D IPTOS_DSCP_AF13=0x38 -D IPTOS_DSCP_AF21=0x48 -D IPTOS_DSCP_AF22=0x50 -D IPTOS_DSCP_AF23=0x58 -D IPTOS_DSCP_AF31=0x68 -D IPTOS_DSCP_AF32=0x70 -D IPTOS_DSCP_AF33=0x78 -D IPTOS_DSCP_AF41=0x88 -D IPTOS_DSCP_AF42=0x90 -D IPTOS_DSCP_AF43=0x98 -D IPTOS_DSCP_EF=0xb8 -D IPTOS_DSCP_CS0=0 -D IPTOS_DSCP_CS1=0x20 -D IPTOS_DSCP_CS2=0x40 -D IPTOS_DSCP_CS3=0x60 -D IPTOS_DSCP_CS4=0x80 -D IPTOS_DSCP_CS5=0xa0 -D IPTOS_DSCP_CS6=0xc0 -D IPTOS_DSCP_CS7=0xe0 -D "FSID_TO_ULONG(V)=(V)" -D "TIMEVAL_TO_TIMESPEC(TV,TS)=do { (TS)->tv_sec = (TV)->tv_sec; (TS)->tv_nsec = (TV)->tv_usec * 1000; } while(0)" -D "MAX(A,B)=(((A)>(B))?(A):(B))" -D "MIN(A,B)=(((A)<(B))?(A):(B))" -D "roundup(A,B)=((((A)+((B)-1))/(B))*(B))" -D "howmany(x,y)=(((x)+((y)-1))/(y))" -D "timersub(tvp, uvp, vvp)=do { (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; if((vvp)->tv_usec < 0) { (vvp)->tv_sec--; (vvp)->tv_usec += 1000000; } } while (0)" -D "__predict_false(exp)=__builtin_expect(((exp) != 0), 0)" -D u_int8_t=uint8_t -D u_int16_t=uint16_t -D u_int32_t=uint32_t -D u_int64_t=uint64_t -I .
CFLAGS += -Wall -Os
SFTP_SERVER_OBJECTS := \
addrmatch.o \
buffer.o \
bufaux.o \
fatal.o \
log.o \
match.o \
misc.o \
sftp-common.o \
sftp-server.o \
sftp-server-main.o \
sshbuf.o \
sshbuf-getput-basic.o \
ssherr.o \
xmalloc.o
OPENBSD_COMPAT_OBJECTS := \
openbsd-compat/bsd-asprintf.o \
openbsd-compat/bsd-misc.o \
openbsd-compat/fmt_scaled.o \
openbsd-compat/pwcache.o \
openbsd-compat/reallocarray.o \
openbsd-compat/strlcat.o \
openbsd-compat/strlcpy.o \
openbsd-compat/strmode.o \
openbsd-compat/strtonum.o \
openbsd-compat/vis.o
sftp-server: libopenbsd-compat.a $(SFTP_SERVER_OBJECTS)
$(CC) $(SFTP_SERVER_OBJECTS) -o $@ -L . -l openbsd-compat $(LIBS)
libopenbsd-compat.a: $(OPENBSD_COMPAT_OBJECTS)
$(AR) -r $@ $^
openbsd-compat/bsd-%.o: openbsd-compat/bsd-%.c
$(CC) $(CFLAGS) --include stdio.h -c $< -o $@
clean:
rm -f sftp-server libopenbsd-compat.a $(SFTP_SERVER_OBJECTS) $(OPENBSD_COMPAT_OBJECTS)