Home | History | Annotate | Download | only in cmenu
      1 ## -----------------------------------------------------------------------
      2 ##
      3 ##   Copyright 2001-2009 H. Peter Anvin - All Rights Reserved
      4 ##   Copyright 2009 Intel Corporation; author: H. Peter Anvin
      5 ##
      6 ##   This program is free software; you can redistribute it and/or modify
      7 ##   it under the terms of the GNU General Public License as published by
      8 ##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
      9 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
     10 ##   (at your option) any later version; incorporated herein by reference.
     11 ##
     12 ## -----------------------------------------------------------------------
     13 
     14 ##
     15 ## Makefile for the complex menu system
     16 ##
     17 
     18 NOGPL := 1
     19 
     20 LIBS  = libmenu/libmenu.c32 \
     21         $(objdir)/com32/libutil/libutil.c32 \
     22         $(objdir)/com32/lib/libcom32.c32
     23 
     24 C_LIBS	  = libmenu/libmenu.c32
     25 
     26 VPATH = $(SRC)
     27 include $(MAKEDIR)/elf.mk
     28 
     29 CFLAGS	  += -I$(SRC)/libmenu
     30 
     31 LIBMENU = libmenu/syslnx.o libmenu/com32io.o libmenu/tui.o \
     32 	libmenu/menu.o libmenu/passwords.o libmenu/des.o libmenu/help.o \
     33 	$(objdir)/com32/libutil/libutil.c32 $(objdir)/com32/lib/libcom32.c32
     34 
     35 CMENUS = $(patsubst %.c,%.c32,$(wildcard $(SRC)/*.c))
     36 IMENUS = $(patsubst %.menu,%.c32,$(wildcard $(SRC)/*.menu))
     37 
     38 MENUS = $(LIBS) $(subst $(SRC)/,,$(CMENUS) $(IMENUS))
     39 
     40 .SUFFIXES: .S .c .o .elf .c32 .menu
     41 
     42 .PRECIOUS: %.c
     43 %.c: %.menu adv_menu.tpl
     44 	$(PYTHON) $(SRC)/menugen.py --input=$< --output=$@ --template=$(SRC)/adv_menu.tpl
     45 
     46 all:	makeoutputdirs menus
     47 
     48 makeoutputdirs:
     49 	@mkdir -p $(OBJ)/libmenu
     50 
     51 libmenu/libmenu.elf: $(LIBMENU)
     52 	$(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
     53 		-o $@ $^
     54 
     55 tidy dist:
     56 	rm -f *.o *.lo *.lst *.elf */*.o */*.elf .*.d */.*.d
     57 
     58 libclean:
     59 	rm -f libmenu/*.c32
     60 
     61 clean: tidy menuclean
     62 	rm -f *.lss *.com
     63 
     64 menuclean:
     65 	rm -f $(patsubst %.menu,%.c,$(wildcard *.menu))
     66 
     67 spotless: clean libclean menuclean
     68 	rm -f *~ \#* *.c32
     69 
     70 menus: $(MENUS)
     71 
     72 install:	# Don't install samples
     73 
     74 -include .*.d */.*.d
     75