6 .PHONY=bin rcp all install clean build armstuff
10 WARNINGS = -W -Wall -Wundef -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wno-format -Wuninitialized
18 PEAL_SRCS = util/peal.c
19 PEAL_FILES = util/peal.c util/peal.h util/elf.h util/elf32.h util/elf_common.h
20 util/peal.c: $(PEAL)/m68k/peal.c
21 cp $(PEAL)/m68k/peal.c util/peal.c
22 util/peal.h: $(PEAL)/m68k/peal.h
23 cp $(PEAL)/m68k/peal.h util/peal.h
24 util/elf.h: $(PEAL)/m68k/elf.h
25 cp $(PEAL)/m68k/elf.h util/elf.h
26 util/elf32.h: $(PEAL)/m68k/elf32.h
27 cp $(PEAL)/m68k/elf32.h util/elf32.h
28 util/elf_common.h: $(PEAL)/m68k/elf_common.h
29 cp $(PEAL)/m68k/elf_common.h util/elf_common.h
33 BN_SRCS = bn/bn_armstubs.c
34 AES_SRCS = aes/aes_armstubs.c
35 DH_SRCS = dh/dh_key.c dh/dh_lib.c
36 DES_SRCS = des/des_enc.c des/set_key.c des/des_tables.c
37 DSA_SRCS = dsa/dsa_lib.c dsa/dsa_ossl.c dsa/dsa_sign.c dsa/dsa_vrf.c
38 EVP_SRCS = evp/digest.c evp/e_des3.c evp/e_aes.c evp/e_null.c evp/evp_enc.c evp/m_md5.c evp/m_sha1.c
39 HMAC_SRCS = hmac/hmac.c
40 MD5_SRCS = md5/md5_dgst.c md5/md5_one.c
41 RSA_SRCS = rsa/rsa_eay.c rsa/rsa_lib.c rsa/rsa_none.c rsa/rsa_pk1.c
42 SHA_SRCS = sha/sha1dgst.c
44 OPENSSL_SRCS = $(addprefix openssl/, \
46 $(AES_SRCS) $(BN_SRCS) $(DH_SRCS) $(DES_SRCS) $(DSA_SRCS) $(EVP_SRCS) \
47 $(HMAC_SRCS) $(MD5_SRCS) $(RSA_SRCS) $(SHA_SRCS) \
50 # crypto (OpenSSL and otherwise)
51 CRYPTO_SRCS = $(addprefix crypto/, \
52 rand_armstubs.c $(OPENSSL_SRCS) \
56 OPENSSH_SRCS = $(addprefix openssh/, \
57 bufaux.c buffer.c cipher.c dh.c kex.c kexdh.c key.c mac.c \
58 match.c ssh-dss.c ssh-rsa.c uuencode.c openbsd-compat/base64.c \
59 openbsd-compat/bsd-snprintf.c \
62 # ssh (OpenSSH and PuTTY and custom)
63 SSH_SRCS = $(addprefix ssh/, \
64 connection.c keyfile.c keyimport.c packetizer.c session.c ssh.c transport.c sshzlib.c \
69 UTIL_SRCS = $(addprefix util/, \
70 armstubs.c formutils.c queue.c stdlib.c xmalloc.c \
74 VT100_SRCS = vt100/vt100.c
77 FORM_SRCS = $(addprefix forms/, \
78 about.c connectionprefsform.c detailsform.c displayprefsform.c \
79 hostkeysform.c hostkeydetailsform.c kbdintform.c kbdint0form.c \
81 loginform.c mainform.c memoform.c passwordform.c passphraseform.c \
82 publickeysform.c publickeychoiceform.c publickeydetailsform.c \
83 terminalform.c DIA.c resize.c \
87 DATA_SRCS = $(addprefix data/, \
88 connectionlist.c hostkeys.c memolist.c prefs.c publickeys.c \
93 SRCS = main.c $(CRYPTO_SRCS) $(FORM_SRCS) $(DATA_SRCS) $(SSH_SRCS) \
94 $(UTIL_SRCS) $(VT100_SRCS) $(PEAL_SRCS)
95 OBJECTS = $(addprefix build/,$(SRCS:.c=.o))
98 RSRC_HDRS = rsrc/rsrc.h crypto/cryptorsrc.h
99 RSRC_SRCS = crypto/openssl/aes/aes_tables.rcp crypto/openssl/des/des_tables.rcp rsrc/pssh.rcp
100 RSRC_OBJS = $(addprefix build/,$(RSRC_SRCS:.rcp=.ro))
102 OBJDIRS = $(addprefix build/,$(sort $(dir $(SRCS) $(dir $(RSRC_SRCS)))))
108 pssh.prc: pssh.def pssh armstuff $(RSRC_OBJS)
109 build-prc -o pssh.prc pssh.def pssh arm/armc.ro $(RSRC_OBJS)
111 pssh: $(PEAL_FILES) $(OBJDIRS) $(OBJECTS) pssh-sections.o pssh-sections.ld
112 m68k-palmos-gcc $(LDFLAGS) $(OBJECTS) pssh-sections.o pssh-sections.ld -lNetSocket -lPalmOSGlue -o pssh
114 pssh-sections.o: pssh-sections.s
115 m68k-palmos-gcc -c pssh-sections.s
117 pssh-sections.s pssh-sections.ld: pssh.def
118 m68k-palmos-multigen pssh.def
123 # fixme need to handle ARM-endian resources better
124 build/crypto/openssl/aes/aes_tables.ro : crypto/openssl/aes/aes_tables.rcp
125 pilrc -LE32 -ro -I crypto -I rsrc $< $@
128 pilrc -ro -I crypto -I rsrc $< $@
137 m68k-palmos-gcc $(CFLAGS) $(OPTIMIZATION) $(WARNINGS) \
138 -I. -Iutil -Iutil/oem -Irsrc $(addprefix -I,$1) \
142 build/crypto/openssl/aes/%.o : crypto/openssl/aes/%.c
143 $(call compile, crypto crypto/openssl crypto/openssl/aes, $<, $@ )
145 build/crypto/openssl/bn/%.o : crypto/openssl/bn/%.c
146 $(call compile, crypto crypto/openssl crypto/openssl/bn, $<, $@ )
148 build/crypto/openssl/des/%.o : crypto/openssl/des/%.c
149 $(call compile, crypto crypto/openssl crypto/openssl/des, $<, $@ )
151 build/crypto/openssl/dh/%.o : crypto/openssl/dh/%.c
152 $(call compile, crypto crypto/openssl crypto/openssl/dh, $<, $@ )
154 build/crypto/openssl/dsa/%.o : crypto/openssl/dsa/%.c
155 $(call compile, crypto crypto/openssl crypto/openssl/dsa, $<, $@ )
157 build/crypto/openssl/evp/%.o : crypto/openssl/evp/%.c
158 $(call compile, crypto crypto/openssl crypto/openssl/evp, $<, $@ )
160 build/crypto/openssl/hmac/%.o : crypto/openssl/hmac/%.c
161 $(call compile, crypto crypto/openssl crypto/openssl/hmac, $<, $@ )
163 build/crypto/openssl/md5/%.o : crypto/openssl/md5/%.c
164 $(call compile, crypto crypto/openssl crypto/openssl/md5, $<, $@ )
166 build/crypto/openssl/sha/%.o : crypto/openssl/sha/%.c
167 $(call compile, crypto crypto/openssl crypto/openssl/sha, $<, $@ )
170 build/crypto/openssl/%.o : crypto/openssl/%.c
171 $(call compile, crypto crypto/openssl, $<, $@ )
174 build/crypto/%.o : crypto/%.c
175 $(call compile, crypto, $<, $@)
177 build/ssh/openssh/openbsd-compat/%.o : ssh/openssh/openbsd-compat/%.c
178 $(call compile, ssh ssh/openssh ssh/openssh/openbsd-compat, $<, $@ )
180 build/ssh/openssh/%.o : ssh/openssh/%.c
181 $(call compile, ssh ssh/openssh crypto, $<, $@ )
183 build/ssh/%.o : ssh/%.c
184 $(call compile, ssh crypto, $<, $@ )
187 build/data/%.o : data/%.c
188 $(call compile, data, $<, $@ )
191 build/forms/%.o : forms/%.c
192 $(call compile, forms, $<, $@ )
195 build/util/%.o : util/%.c
196 $(call compile, , $<, $@ )
199 build/vt100/%.o : vt100/%.c
200 $(call compile, vt100 vt100/palm, $<, $@ )
204 $(call compile, , $<, $@ )
211 rm -f *~ *.grc *.bin *.o *.prc pssh pssh-sections.ld pssh-sections.s
212 rm -f $(addsuffix *~,rsrc/ crypto/openssl/objects/ $(sort $(dir $(SRCS))))
213 rm -f $(addsuffix .gdb_history,rsrc/ crypto/openssl/objects/ $(sort $(dir $(SRCS))))