# Makefile for prc-tools crt files. # # Copyright 2001, 2002, 2003 John Marshall. # Portions copyright (c) 1998, 1999 Palm Computing, Inc. or its subsidiaries. # All rights reserved. # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. srcdir = @srcdir@ VPATH = @srcdir@ #stop prefix = @prefix@ exec_prefix = @exec_prefix@ target_alias = @target_alias@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ SDKFLAGS = MULTIFLAGS = CC = $(target_alias)-gcc AR = $(target_alias)-ar RANLIB = $(target_alias)-ranlib # Don't use -fomit-frame-pointer just now: it's broken # CFLAGS = -O5 -fomit-frame-pointer -fno-builtin -Wall -W CFLAGS = -O5 -fno-builtin -Wall -W -g \ -I$(srcdir)/../include $(SDKFLAGS) $(MULTIFLAGS) MOWN_GP_FILES = mown-gp/crt0.o mown-gp/scrt0.o mown-gp/gdbstub.o \ mown-gp/libcrt.a INSTALL_C_LIBS = crt0.o gdbstub.o libcrt.a libnfm.a text_64k text_64k_palmos3 INSTALL_CXX_LIBS = libnoexcept.a INSTALL_FILES = $(INSTALL_C_LIBS) @install_cxx_libs@ $(MOWN_GP_FILES) all: $(INSTALL_FILES) install: $(INSTALL_FILES) $(INSTALL) -d $(DESTDIR)$(exec_prefix)/$(target_alias)/lib $(INSTALL) -d $(DESTDIR)$(exec_prefix)/$(target_alias)/lib/mown-gp for f in $(INSTALL_FILES); do \ $(INSTALL_DATA) $$f $(DESTDIR)$(exec_prefix)/$(target_alias)/lib/$$f;\ done .PHONY: all install clean sub-multilibs crt0.o: crt0.c ../include/NewTypes.h crt.h scrt0.o: scrt0.c ../include/NewTypes.h crt.h palmos_GLib.h hooks.o: hooks.c ../include/NewTypes.h crt.h gdbstub.o: gdbstub.c ../include/NewTypes.h crt.h palmos_GLib.o: palmos_GLib.c ../include/NewTypes.h palmos_GLib.h DRELOC_OBJS = single_dreloc.o multi_dreloc.o multi_free.o reloc_chain.o $(DRELOC_OBJS): dreloc.c ../include/NewTypes.h crt.h $(CC) $(CFLAGS) -c -o $@ -DL`basename $@ .o` $(srcdir)/dreloc.c CRTLIB_OBJS = hooks.o palmos_GLib.o $(DRELOC_OBJS) libcrt.a: $(CRTLIB_OBJS) -rm -f $@ $(AR) cr $@ $(CRTLIB_OBJS) $(RANLIB) $@ mown-gp/Makefile: Makefile if [ ! -d mown-gp ]; then mkdir mown-gp; fi sed '1,/^#stop/s,= \([^/]\),= ../\1,' Makefile > mown-gp/Makefile $(MOWN_GP_FILES): sub-multilibs sub-multilibs: mown-gp/Makefile cd mown-gp; $(MAKE) CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" \ SDKFLAGS="$(SDKFLAGS)" MULTIFLAGS=-mown-gp \ `echo $(MOWN_GP_FILES) | sed 's,[^ /]*/,,g'` text_64k: text_in sed "s/@@@@@/`grep 'Palm OS 1\.0' text_in | \ sed 's/is.*//' | sed 's/[^0-9]//g'`/" text_in > $@ text_64k_palmos3: text_in sed "s/@@@@@/`grep 'Palm OS 3\.0' text_in | \ sed 's/is.*//' | sed 's/[^0-9]//g'`/" text_in > $@ text_in: $(CC) -nostartfiles -nostdlib -Wl,--verbose 2>&1 | \ sed -n '/^=/,/^=/p' | grep -v '^=' | \ sed '/coderes/s/LENGTH = [0-9]*/LENGTH = @@@@@/' > $@ NOEXCEPTLIB_OBJS = new.o vnew.o newnt.o vnewnt.o del.o vdel.o delnt.o vdelnt.o libnoexcept.a: $(NOEXCEPTLIB_OBJS) -rm -f libnoexcept.a $(AR) cr $@ $(NOEXCEPTLIB_OBJS) $(RANLIB) $@ $(NOEXCEPTLIB_OBJS): new12.cc $(CC) $(CFLAGS) -fno-exceptions -fno-rtti -c -o $@ -DL`basename $@ .o` $(srcdir)/new12.cc NFMLIB_OBJS = \ floatsisf.o floatdisf.o floatsidf.o floatdidf.o \ extendsfdf2.o truncdfsf2.o \ fixunssfsi.o fixsfsi.o fixunssfdi.o fixsfdi.o \ fixunsdfsi.o fixdfsi.o fixunsdfdi.o fixdfdi.o \ cmp_sf.o cmp_df.o cmpmap.o \ negsf2.o addsf3.o mulsf3.o subsf3.o divsf3.o \ negdf2.o adddf3.o muldf3.o subdf3.o divdf3.o libnfm.a: $(NFMLIB_OBJS) -rm -f libnfm.a $(AR) cr libnfm.a $(NFMLIB_OBJS) $(RANLIB) libnfm.a $(NFMLIB_OBJS): nfm.c $(CC) $(CFLAGS) -c -o $@ -DL__`basename $@ .o` $(srcdir)/nfm.c clean: -rm -f *.o *.a text_* -rm -rf mown-gp