blob: 0ed833cb007b792772757f1c89abdd07b1f1b749 [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 Landleybf081b92008-03-28 00:40:57 -05009.PHONY: clean distclean baseline bloatcheck install install_flat \
Rob Landley09c13c92008-03-29 17:25:28 -050010 uinstall uninstall_flat test tests help scripts/test
Rob Landley401ae8f2006-11-01 22:26:25 -050011
12include kconfig/Makefile
13
Rob Landley28964802008-01-19 17:08:39 -060014$(KCONFIG_TOP): generated/Config.in
15generated/Config.in:
16 scripts/genconfig.sh
Rob Landleyde05a702007-01-31 14:37:01 -050017
Rob Landley28964802008-01-19 17:08:39 -060018HOSTCC:=cc
Rob Landley401ae8f2006-11-01 22:26:25 -050019
Rob Landleycd2edfd2006-11-26 18:47:14 -050020# Development targets
21baseline: toybox_unstripped
22 @cp toybox_unstripped toybox_old
23
24bloatcheck: toybox_old toybox_unstripped
25 @scripts/bloat-o-meter toybox_old toybox_unstripped
26
Rob Landleybcfad872007-01-31 14:18:05 -050027instlist: toybox
Rob Landley30d79a12007-05-29 16:26:47 -040028 $(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist
Rob Landleybcfad872007-01-31 14:18:05 -050029
30install_flat: instlist
Rob Landley05fbd1e2008-03-28 00:09:31 -050031 scripts/install.sh --symlink --force
32
33install:
34 scripts/install.sh --long --symlink --force
Rob Landleybcfad872007-01-31 14:18:05 -050035
Rob Landleybf081b92008-03-28 00:40:57 -050036uninstall_flat: instlist
37 scripts/install.sh --uninstall
38
39uninstall:
40 scripts/install.sh --long --uninstall
41
Rob Landley401ae8f2006-11-01 22:26:25 -050042clean::
Rob Landley7a585c62008-02-23 15:02:11 -060043 rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
44 generated/newtoys.h generated/globals.h instlist testdir
Rob Landley401ae8f2006-11-01 22:26:25 -050045
46distclean: clean
Rob Landley58ecc3e2008-01-10 14:40:13 -060047 rm -f toybox_old .config* generated/help.h
Rob Landleycd2edfd2006-11-26 18:47:14 -050048
Rob Landleye35f2b82007-06-18 01:09:00 -040049test: tests
50
51tests:
Rob Landley9d243a22008-03-28 00:44:44 -050052 scripts/test.sh
Rob Landleye35f2b82007-06-18 01:09:00 -040053
Rob Landleycd2edfd2006-11-26 18:47:14 -050054help::
Rob Landley28964802008-01-19 17:08:39 -060055 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050056 @echo ' baseline - Create busybox_old for use by bloatcheck.'
57 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060058 @echo ' test - Run test suite against compiled commands.'
59 @echo ' clean - Delete temporary files.'
60 @echo ' distclean - Delete everything that isn't shipped.'
61 @echo ' install_flat - Install toybox into $PREFIX directory.'
Rob Landley9d243a22008-03-28 00:44:44 -050062 @echo ' install - Install toybox into subdirectories of $PREFIX.'
63 @echo ' uninstall_flat - Remove toybox from $PREFIX directory."
64 @echo ' uninstall - Remove toybox from subdirectories of $PREFIX."