blob: 713a66d6c3afa7b8e5c0356cb0e7d4c890d420b6 [file] [log] [blame]
Rob Landley401ae8f2006-11-01 22:26:25 -05001# Makefile for toybox.
2# Copyright 2006 Rob Landley <rob@landley.net>
landleyc5621502006-09-28 17:18:51 -04003
Rob Landley401ae8f2006-11-01 22:26:25 -05004all: toybox
5
Rob Landley58c85082008-02-17 16:19:52 -06006toybox toybox_unstripped: .config *.[ch] lib/*.[ch] toys/*.[ch] scripts/*
Rob Landley28964802008-01-19 17:08:39 -06007 scripts/make.sh
8
Rob Landley05fbd1e2008-03-28 00:09:31 -05009.PHONY: clean distclean baseline bloatcheck install install_flat test tests help
Rob Landley401ae8f2006-11-01 22:26:25 -050010
11include kconfig/Makefile
12
Rob Landley28964802008-01-19 17:08:39 -060013$(KCONFIG_TOP): generated/Config.in
14generated/Config.in:
15 scripts/genconfig.sh
Rob Landleyde05a702007-01-31 14:37:01 -050016
Rob Landley28964802008-01-19 17:08:39 -060017HOSTCC:=cc
Rob Landley401ae8f2006-11-01 22:26:25 -050018
Rob Landleycd2edfd2006-11-26 18:47:14 -050019# Development targets
20baseline: toybox_unstripped
21 @cp toybox_unstripped toybox_old
22
23bloatcheck: toybox_old toybox_unstripped
24 @scripts/bloat-o-meter toybox_old toybox_unstripped
25
Rob Landleybcfad872007-01-31 14:18:05 -050026instlist: toybox
Rob Landley30d79a12007-05-29 16:26:47 -040027 $(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist
Rob Landleybcfad872007-01-31 14:18:05 -050028
29install_flat: instlist
Rob Landley05fbd1e2008-03-28 00:09:31 -050030 scripts/install.sh --symlink --force
31
32install:
33 scripts/install.sh --long --symlink --force
Rob Landleybcfad872007-01-31 14:18:05 -050034
Rob Landley401ae8f2006-11-01 22:26:25 -050035clean::
Rob Landley7a585c62008-02-23 15:02:11 -060036 rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
37 generated/newtoys.h generated/globals.h instlist testdir
Rob Landley401ae8f2006-11-01 22:26:25 -050038
39distclean: clean
Rob Landley58ecc3e2008-01-10 14:40:13 -060040 rm -f toybox_old .config* generated/help.h
Rob Landleycd2edfd2006-11-26 18:47:14 -050041
Rob Landleye35f2b82007-06-18 01:09:00 -040042test: tests
43
44tests:
45 scripts/testall.sh
46
Rob Landleycd2edfd2006-11-26 18:47:14 -050047help::
Rob Landley28964802008-01-19 17:08:39 -060048 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050049 @echo ' baseline - Create busybox_old for use by bloatcheck.'
50 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060051 @echo ' test - Run test suite against compiled commands.'
52 @echo ' clean - Delete temporary files.'
53 @echo ' distclean - Delete everything that isn't shipped.'
54 @echo ' install_flat - Install toybox into $PREFIX directory.'