]> asedeno.scripts.mit.edu Git - pssh.git/blob - Makefile
updates to device ids
[pssh.git] / Makefile
1 # pssh makefile
2
3 all: install
4
5
6 .PHONY=bin rcp all install clean build armstuff
7 .SUFFIXES=
8
9 OPTIMIZATION = -Os
10 WARNINGS = -W -Wall -Wundef -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wno-format -Wuninitialized
11
12 # CFLAGS = -g
13 # LDFLAGS = -g
14
15
16 # Peal
17 PEAL = ../peal
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
30
31
32 # OpenSSL
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
43
44 OPENSSL_SRCS = $(addprefix openssl/, \
45         mem_clr.c \
46         $(AES_SRCS) $(BN_SRCS) $(DH_SRCS) $(DES_SRCS) $(DSA_SRCS) $(EVP_SRCS) \
47         $(HMAC_SRCS) $(MD5_SRCS) $(RSA_SRCS) $(SHA_SRCS) \
48 )
49
50 # crypto (OpenSSL and otherwise)
51 CRYPTO_SRCS = $(addprefix crypto/, \
52         rand_armstubs.c $(OPENSSL_SRCS) \
53 )
54
55 # OpenSSH
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 \
60 )
61
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 \
65         $(OPENSSH_SRCS) \
66 )
67
68 # util
69 UTIL_SRCS = $(addprefix util/, \
70         armstubs.c formutils.c queue.c stdlib.c xmalloc.c \
71 )
72
73 # vt100 (PuTTY)
74 VT100_SRCS = vt100/vt100.c
75
76 # Palm forms
77 FORM_SRCS = $(addprefix forms/, \
78         about.c connectionprefsform.c detailsform.c displayprefsform.c \
79         hostkeysform.c hostkeydetailsform.c kbdintform.c kbdint0form.c \
80         keyboardprefsform.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 \
84 )
85
86 # Palm data
87 DATA_SRCS = $(addprefix data/, \
88         connectionlist.c hostkeys.c memolist.c prefs.c publickeys.c \
89         recordlist.c \
90 )
91
92 # Everything 68K
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))
96
97 # rsrc
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))
101
102 OBJDIRS = $(addprefix build/,$(sort $(dir $(SRCS) $(dir $(RSRC_SRCS)))))
103
104
105 install: pssh.prc
106         -open pssh.prc
107
108 pssh.prc: pssh.def pssh armstuff $(RSRC_OBJS)
109         build-prc -o pssh.prc pssh.def pssh arm/armc.ro $(RSRC_OBJS)
110
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
113
114 pssh-sections.o: pssh-sections.s
115         m68k-palmos-gcc -c pssh-sections.s
116
117 pssh-sections.s pssh-sections.ld: pssh.def
118         m68k-palmos-multigen pssh.def
119
120 armstuff: 
121         make -C arm
122
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 $< $@
126
127 build/%.ro : %.rcp
128         pilrc -ro -I crypto -I rsrc $< $@
129
130 $(OBJDIRS): 
131         mkdir -p $@
132
133
134 # 68K C file targets
135
136 define compile
137         m68k-palmos-gcc $(CFLAGS) $(OPTIMIZATION) $(WARNINGS) \
138            -I. -Iutil -Iutil/oem -Irsrc $(addprefix -I,$1) \
139            -c $2 -o $3
140 endef
141
142 build/crypto/openssl/aes/%.o  : crypto/openssl/aes/%.c
143         $(call compile, crypto crypto/openssl crypto/openssl/aes,  $<, $@ )
144
145 build/crypto/openssl/bn/%.o   : crypto/openssl/bn/%.c
146         $(call compile, crypto crypto/openssl crypto/openssl/bn,   $<, $@ )
147
148 build/crypto/openssl/des/%.o  : crypto/openssl/des/%.c
149         $(call compile, crypto crypto/openssl crypto/openssl/des,  $<, $@ )
150
151 build/crypto/openssl/dh/%.o   : crypto/openssl/dh/%.c
152         $(call compile, crypto crypto/openssl crypto/openssl/dh,   $<, $@ )
153
154 build/crypto/openssl/dsa/%.o  : crypto/openssl/dsa/%.c
155         $(call compile, crypto crypto/openssl crypto/openssl/dsa,  $<, $@ )
156
157 build/crypto/openssl/evp/%.o  : crypto/openssl/evp/%.c
158         $(call compile, crypto crypto/openssl crypto/openssl/evp,  $<, $@ )
159
160 build/crypto/openssl/hmac/%.o : crypto/openssl/hmac/%.c
161         $(call compile, crypto crypto/openssl crypto/openssl/hmac, $<, $@ )
162
163 build/crypto/openssl/md5/%.o  : crypto/openssl/md5/%.c
164         $(call compile, crypto crypto/openssl crypto/openssl/md5,  $<, $@ )
165
166 build/crypto/openssl/sha/%.o  : crypto/openssl/sha/%.c
167         $(call compile, crypto crypto/openssl crypto/openssl/sha,  $<, $@ )
168
169
170 build/crypto/openssl/%.o  : crypto/openssl/%.c
171         $(call compile, crypto crypto/openssl,  $<, $@ )
172
173
174 build/crypto/%.o : crypto/%.c
175         $(call compile, crypto, $<, $@)
176
177 build/ssh/openssh/openbsd-compat/%.o  : ssh/openssh/openbsd-compat/%.c
178         $(call compile, ssh ssh/openssh ssh/openssh/openbsd-compat,  $<, $@ )
179
180 build/ssh/openssh/%.o  : ssh/openssh/%.c
181         $(call compile, ssh ssh/openssh crypto,  $<, $@ )
182
183 build/ssh/%.o  : ssh/%.c
184         $(call compile, ssh crypto,  $<, $@ )
185
186
187 build/data/%.o  : data/%.c
188         $(call compile, data,  $<, $@ )
189
190
191 build/forms/%.o  : forms/%.c
192         $(call compile, forms,  $<, $@ )
193
194
195 build/util/%.o  : util/%.c
196         $(call compile, ,  $<, $@ )
197
198
199 build/vt100/%.o  : vt100/%.c
200         $(call compile, vt100 vt100/palm,  $<, $@ )
201
202
203 build/%.o  : %.c
204         $(call compile, ,  $<, $@ )
205
206
207 clean: 
208         make -C arm clean
209         rm -rf build
210         rm -f $(PEAL_FILES)
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))))