home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / Makefile < prev    next >
Encoding:
Makefile  |  1998-10-13  |  6.9 KB  |  239 lines

  1. VERSION = 1.2
  2.  
  3. STRIP =  strip
  4. DEBUG = -g
  5. CC = egcs
  6.  
  7. OPTS = -O
  8.  
  9. CFLAGS = $(DEBUG) $(OPTS) -Wall -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE=1 -I /usr/include/rpm -DUSE_ALT_DNS=1
  10. LDFLAGS = $(DEBUG) 
  11. CRYPT=/usr/lib/libcrypt.a
  12.  
  13. ARCH := $(patsubst i%86,i386,$(shell uname -m))
  14. ifeq (alpha,$(ARCH))
  15. ARCHOBJS2 = kernel.o kbd.o
  16. ARCHOBJS1 = kbd.o
  17. else
  18. ifeq (i386,$(ARCH))
  19. ARCHOBJS2 = lilo.o smb.o kbd.o
  20. ARCHOBJS1 = smb.o kbd.o
  21. else
  22. # SPARC
  23. ARCHOBJS2 = lilo.o
  24. endif
  25. endif
  26.  
  27. OBJS = net.o log.o nfsmount.o mount_xdr.o windows.o devices.o \
  28.     scsi.o fs.o run.o bootpc.o dns.o kickstart.o lang.o cdrom.o \
  29.     cpio.o otherinsmod.o
  30. OBJS1 = earlymethods.o install.o $(ARCHOBJS1)
  31. OBJS2 = doit.o pkgs.o config.o hd.o latemethods.o install2.o ftp.o \
  32.     upgrade.o hash.o commands.o printercfg.o gettext.o hints.o \
  33.     mkswap.o mtab.o syslog.o ls.o idmap.o fsedit.o $(ARCHOBJS2) 
  34. ALLOBJS = $(OBJS) $(OBJS1) $(OBJS2)
  35. PROGS = install install2 genhdlist dmphdlist
  36.  
  37. SOURCES = $(subst .o,.c,$(OBJS))
  38. SOURCES1 = $(subst .o,.c,$(OBJS1))
  39. SOURCES2 = $(subst .o,.c,$(OBJS2))
  40. EARLYSECOND = hd.c fsedit.c latemethods.c mtab.c mkswap.c install2.c ftp.c \
  41.           mkswap.c
  42. LATESECOND = $(filter-out $(EARLYSECOND),$(SOURCES2))
  43. ALLSOURCES = $(SOURCES) $(SOURCES1) $(SOURCES2)
  44.  
  45. #---------------
  46.  
  47. INST1LIBS:=-lpopt /usr/lib/libnewt.a /usr/lib/libslang.a /usr/lib/libm.a \
  48.         /usr/lib/libresolv.a modutils/insmod/libmodutils.a \
  49.         modutils/obj/libobj.a modutils/util/libutil.a
  50. INST2LIBS:=-lpopt /usr/lib/libdb.a /usr/lib/libz.a /usr/lib/libslang.a \
  51.             /usr/lib/libm.a /usr/lib/libresolv.a modutils/insmod/libmodutils.a \
  52.         modutils/obj/libobj.a modutils/util/libutil.a
  53. INST1DEPLIBS=
  54. INST2DEPLIBS=./libfdisk/libfdisk.a
  55.  
  56. SUBDIRS=modutils libfdisk
  57.  
  58. ifeq (i386,$(ARCH))
  59. STATIC=-static
  60. INST1DEPLIBS+=./pci-probing/libpciprobe.a ./pcmcia-probing/libpcmciaprobe.a
  61. INST2LIBS:=/usr/lib/libnewt.a $(INST2LIBS)
  62. INST2DEPLIBS+=./pci-probing/libpciprobe.a
  63. SUBDIRS+=pci-probing pcmcia-probing 
  64. else
  65. ifeq (alpha,$(ARCH))
  66. STATIC=
  67. INST1DEPLIBS+=
  68. INST2LIBS:=/usr/lib/libnewt.a $(INST2LIBS)
  69. SUBDIRS+=
  70. else
  71. ifeq (sparc,$(ARCH))
  72. STATIC=
  73. INST1DEPLIBS+=
  74. INST2LIBS:=/usr/lib/libnewt.a $(INST2LIBS)
  75. INST2DEPLIBS+=
  76. SUBDIRS+=
  77. endif
  78. endif
  79. STATIC=
  80. INST2LIBS:=/usr/lib/libnewt.a $(INST2LIBS)
  81. endif
  82.  
  83. INST1LIBS+=/usr/lib/libz.a -lrpm
  84.  
  85. ifeq (.depend,$(wildcard .depend))
  86. TARGET=subdirs $(PROGS)
  87. else
  88. TARGET=depend subdirs $(PROGS)
  89. endif
  90.  
  91. LANGS = cs fi no tr ro sr sk de da se it
  92. TR1 = $(patsubst %,tr/%1.tr,$(LANGS))
  93. TR2 = $(patsubst %,tr/%2.tr,$(LANGS))
  94. TR3 = $(patsubst %,tr/%3.tr,$(LANGS))
  95.  
  96. all: $(TARGET) 
  97. #translations
  98.  
  99. translations: install1.tr install2.tr install3.tr
  100.  
  101. install: $(OBJS) $(OBJS1) $(INST1DEPLIBS)
  102.     gcc $(STATIC) $(LDFLAGS) -o install $^ $(INST1LIBS) $(INST1DEPLIBS)
  103.  
  104. install2: $(OBJS) $(OBJS2) /usr/lib/librpm.a $(INST2DEPLIBS)
  105.     gcc $(LDFLAGS) -o install2 $^ $(INST2LIBS) $(CRYPT) $(INST2DEPLIBS)
  106.  
  107. subdirs:
  108.     for d in $(SUBDIRS); do \
  109.     (cd $$d; $(MAKE)) \
  110.       || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac;\
  111.         done && test -z "$$fail"
  112.  
  113. po/rhinstall.po: $(ALLSOURCES)
  114.     cd po; xgettext --default-domain=rhinstall --add-comments \
  115.         --keyword=_ --keyword=N_ \
  116.         $(patsubst %,../%,$(ALLSOURCES))
  117.  
  118. tr/%3.tr: po/%.po install3.po
  119.     msgmerge $< install3.po | ./simplemot > $@
  120.  
  121. tr/%2.tr: po/%.po install2.po
  122.     msgmerge $< install2.po | ./simplemot > $@
  123.  
  124. tr/%1.tr: po/%.po install1.po 
  125.     msgmerge $< install1.po | ./simplemot > $@
  126.  
  127. install1.tr: $(TR1) 
  128.     (cd tr; ls *1.tr | cpio --quiet -Hcrc -o | gzip -9) > $@
  129.  
  130. install2.tr: $(TR2) 
  131.     (cd tr; ls *2.tr | cpio --quiet -Hcrc -o | gzip -9) > $@
  132.  
  133. install3.tr: $(TR3) 
  134.     (cd tr; ls *3.tr | cpio --quiet -Hcrc -o | gzip -9) > $@
  135.  
  136. .PHONY: update-po
  137. update-po: po/rhinstall.po
  138.     @for n in $(LANGS); do \
  139.         echo msgmerge po/$$n.po po/rhinstall.po ;\
  140.         msgmerge po/$$n.po po/rhinstall.po > po/$$n.pot && \
  141.         mv -f po/$$n.pot po/$$n.po ;\
  142.     done
  143.  
  144.  
  145. # install1.po and install2.po aren't strictally necessary, but they let
  146. # us move the install2 specific translations off the first disk. 
  147. #
  148. # We split into an install3 as well for now. It makes install2.tr smaller,
  149. # which lets it fit onto the supp disk easier <sigh>, and install3.tr is
  150. # brought over frm the installation media. We should get rid of the install3
  151. # tr hack altogether, and completely setup the installation media in the
  152. # first stage. 
  153. install1.po: $(SOURCES) $(SOURCES1)
  154.     xgettext --default-domain=install1 --add-comments \
  155.         --keyword=_ --keyword=N_ $(SOURCES) $(SOURCES1)
  156.  
  157. install2.po: $(EARLYSECOND)
  158.     xgettext --default-domain=install2 --add-comments \
  159.         --keyword=_ --keyword=N_ $(EARLYSECOND)
  160.  
  161. install3.po: $(LATESECOND)
  162.     xgettext --default-domain=install3 --add-comments \
  163.         --keyword=_ --keyword=N_ $(LATESECOND)
  164.  
  165. ftp.o: ftp.c
  166.     $(CC) $(CFLAGS) -DHAVE_CONFIG_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_NETINET_IN_SYSTM_H=1 -c $<
  167.  
  168. genhdlist: /usr/lib/librpm.a gettext.o genhdlist.o
  169.     gcc -o genhdlist genhdlist.o -lrpm -lz
  170.  
  171. dmphdlist: /usr/lib/librpm.a gettext.o dmphdlist.o
  172.     gcc -o dmphdlist dmphdlist.o -lrpm -lz
  173.  
  174. ugtest: ugtest.o pkgs.o upgrade.o log.o windows.o hash.o kickstart.o
  175.     gcc $(LDFLAGS) -o ugtest $^ $(INST2LIBS) -lrpm -ldb -lz
  176.  
  177. clean: 
  178.     rm -f *.o .depend
  179.  
  180.     # get subdirectories as well
  181.     for d in $(SUBDIRS); do \
  182.     (cd $$d; $(MAKE) clean) \
  183.       || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac;\
  184.         done && test -z "$$fail"
  185.  
  186. ifeq (i386,$(ARCH))
  187. installit: translations
  188.     rm -f ../../../RedHat/instimage/usr/bin/install2
  189.     cp install2 ../../../RedHat/instimage/usr/bin
  190.     cp install2 install2.foo
  191.     strip install2.foo
  192.     bzip2 -9 < install2.foo > ../trees/supp/usr/bin/install2
  193.     rm -f ../../../RedHat/instimage/usr/etc/install2.tr
  194.     cp install2.tr ../../../RedHat/instimage/usr/etc
  195.     cp install2.tr ../trees/supp/usr/etc/install2.tr
  196.     rm -f ../../../RedHat/base/install3.tr
  197.     cp install3.tr ../../../RedHat/base/install3.tr
  198.     install -s install ../trees/initrd/bin/install
  199.     cp -f install1.tr ..//trees/initrd/etc/install1.tr
  200. else
  201. ifeq (alpha,$(ARCH))
  202. installit: translations
  203.     rm -f ../trees/boot/bin/install
  204.     rm -f ../trees/boot/bin/install2
  205.     rm -f ../trees/boot/etc/install1.tr
  206.     rm -f ../trees/boot/etc/install2.tr
  207.     install -s install ../trees/boot/bin/install
  208.     install -s install2 ../trees/boot/bin/install2
  209.     install install1.tr ../trees/boot/etc/install1.tr
  210.     install install2.tr ../trees/boot/etc/install2.tr
  211.     rm -f ../../../RedHat/base/install3.tr
  212.     install install3.tr ../../../RedHat/base/install3.tr
  213. else
  214. ifeq (sparc,$(ARCH))
  215. installit: translations
  216.     rm -f ../trees/ramdisk/bin/install
  217.     rm -f ../trees/ramdisk/bin/install2
  218.     rm -f ../trees/ramdisk/etc/install1.tr
  219.     rm -f ../trees/ramdisk/etc/install2.tr
  220.     install -s install ../trees/ramdisk/bin/install
  221.     install -s install2 ../trees/ramdisk/bin/install2
  222.     install install1.tr ../trees/ramdisk/etc/install1.tr
  223.     install install2.tr ../trees/ramdisk/etc/install2.tr
  224.     rm -f ../../../RedHat/base/install3.tr
  225.     install install3.tr ../../../RedHat/base/install3.tr
  226. endif
  227. endif
  228. endif
  229.  
  230. depend:
  231.     $(CPP) $(CFLAGS) -M $(ALLSOURCES) > .depend
  232.  
  233. co:
  234.     co RCS/*,v
  235.  
  236. ifeq (.depend,$(wildcard .depend))
  237. include .depend
  238. endif                                           
  239.