Home | History | Annotate | Download | only in toybox
      1 # Makefile for toybox.
      2 # Copyright 2006 Rob Landley <rob (at] landley.net>
      3 
      4 # If people set these on the make command line, use 'em
      5 # Note that CC defaults to "cc" so the one in configure doesn't get
      6 # used when scripts/make.sh and care called through "make".
      7 
      8 HOSTCC?=cc
      9 
     10 export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V STRIP
     11 
     12 all: toybox
     13 
     14 KCONFIG_CONFIG ?= .config
     15 
     16 toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*/*.c scripts/*.sh
     17 
     18 toybox generated/unstripped/toybox: toybox_stuff
     19 	scripts/make.sh
     20 
     21 .PHONY: clean distclean baseline bloatcheck install install_flat \
     22 	uinstall uninstall_flat tests help toybox_stuff change \
     23 	list list_working list_pending
     24 
     25 include kconfig/Makefile
     26 -include .singlemake
     27 
     28 $(KCONFIG_CONFIG): $(KCONFIG_TOP)
     29 	@if [ -e "$(KCONFG_CONFIG)" ]; then make silentoldconfig; \
     30 	else echo "Not configured (run 'make defconfig' or 'make menuconfig')";\
     31 	exit 1; fi
     32 
     33 $(KCONFIG_TOP): generated/Config.in generated/Config.probed
     34 generated/Config.in: toys/*/*.c scripts/genconfig.sh
     35 	scripts/genconfig.sh
     36 
     37 # Development targets
     38 baseline: generated/unstripped/toybox
     39 	@cp generated/unstripped/toybox generated/unstripped/toybox_old
     40 
     41 bloatcheck: generated/unstripped/toybox_old generated/unstripped/toybox
     42 	@scripts/bloatcheck generated/unstripped/toybox_old generated/unstripped/toybox
     43 
     44 install_flat:
     45 	scripts/install.sh --symlink --force
     46 
     47 install_airlock:
     48 	scripts/install.sh --symlink --force --airlock
     49 
     50 install:
     51 	scripts/install.sh --long --symlink --force
     52 
     53 uninstall_flat:
     54 	scripts/install.sh --uninstall
     55 
     56 uninstall:
     57 	scripts/install.sh --long --uninstall
     58 
     59 change:
     60 	scripts/change.sh
     61 
     62 clean::
     63 	rm -rf toybox generated change .singleconfig*
     64 
     65 # If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
     66 distclean: clean
     67 	rm -f toybox_old .config* .singlemake
     68 
     69 tests:
     70 	scripts/test.sh
     71 
     72 help::
     73 	@cat scripts/help.txt
     74