07070100000001000081a400000000000000000000000145d9130000000018000000000000000000000000000000000000001100000000etc/project-name example-c-plus-plus.1.0 07070100000002000081a400000000000000000000000145d9130000000003000000000000000000000000000000000000001200000000etc/change-number24 07070100000003000081a400000000000000000000000145d913000000473a000000000000000000000000000000000000000f00000000etc/change-set brief_description = "The \"example-c-plus-plus\" program, branch 1.0."; description = "The \"example-c-plus-plus\" program, branch 1.0."; cause = internal_enhancement; test_exempt = true; test_baseline_exempt = true; regression_test_exempt = false; attribute = [ { name = "original-UUID"; value = "e6bd3dca-54f6-4304-b6d6-eb7fdfdfcf43"; }, { name = "original-UUID"; value = "ef8d6957-dffa-45c3-b00e-745d502766f5"; }, { name = "original-UUID"; value = "16e69cf4-63f2-413a-a4d8-06389cad5fed"; }, { name = "original-UUID"; value = "77797812-4332-4c09-a844-e65697d04316"; }, { name = "original-UUID"; value = "bf729d1e-a95d-48dc-92ae-aaada7af4404"; }, { name = "original-UUID"; value = "c55fb61d-7468-476e-85b3-f91ed7ef8c3f"; }, { name = "original-UUID"; value = "42af5370-c499-4f1f-8460-6a559c99e9a3"; }, { name = "original-UUID"; value = "d10105ed-40bc-499d-bbde-fb03f14ab9df"; }, { name = "original-UUID"; value = "34067395-e264-4c7a-b49b-eb3fe3baff7c"; }, { name = "original-UUID"; value = "6cc7096e-061e-48c6-b433-603c2ed785ca"; }, { name = "original-UUID"; value = "88ada49d-bcf3-4d70-8f41-d631072e15ab"; }, { name = "original-UUID"; value = "56138468-8b6a-4f41-bb6b-0acbc118928e"; }, { name = "original-UUID"; value = "d8004283-9428-48e9-9d2a-ebf9a9d33059"; }, { name = "original-UUID"; value = "ac796932-0a18-4ad6-a10f-c35499208e65"; }, { name = "original-UUID"; value = "56baec30-20b3-4c26-b89f-b927f1f737cd"; }, { name = "original-UUID"; value = "e87235c0-2199-4216-838c-b396f86d4e95"; }, ]; state = awaiting_development; src = [ { file_name = "Howto.cook"; uuid = "49668792-e79d-47f0-a923-3539749aa0ee"; action = create; usage = source; }, { file_name = "LICENSE"; uuid = "620d4846-e816-4d28-99e6-65d1485004fb"; action = create; usage = source; }, { file_name = "README.html"; uuid = "0f39277a-6ae6-40bb-9897-7aa31019260e"; action = create; usage = source; }, { file_name = "aegis.conf"; uuid = "e4ebb27e-3cc8-4cd2-8011-670c34159f8a"; action = create; usage = config; }, { file_name = "aegis.conf.d/aesvt"; uuid = "6afa4321-756d-4e98-aa67-acbb1dc9ab05"; action = create; usage = config; }, { file_name = "aegis.conf.d/cook"; uuid = "1ef3305b-6170-4205-985d-84a02b5ca0be"; action = create; usage = config; }, { file_name = "aegis.conf.d/diff"; uuid = "35bde5dd-1ef4-4526-9de2-acddfdd033ac"; action = create; usage = config; }, { file_name = "aegis.conf.d/merge"; uuid = "98754819-582f-43a1-8d1e-ba881c4a63f1"; action = create; usage = config; }, { file_name = "aegis.conf.d/template"; uuid = "764d7b41-8586-4631-8329-1376ba88be3a"; action = create; usage = config; }, { file_name = "calc/gram.h"; uuid = "5d8970bf-60dd-45cd-af18-2ab2ea55beb4"; action = create; usage = source; }, { file_name = "calc/gram.l"; uuid = "824658a9-e7c7-4f71-a330-047a4fbd0e52"; action = create; usage = source; }, { file_name = "calc/gram.y"; uuid = "96a6eb53-2cb5-448e-890c-6531c5907a95"; action = create; usage = source; }, { file_name = "calc/main.cc"; uuid = "18395270-f5f2-4600-9ebd-4fdb68e778af"; action = create; usage = source; }, { file_name = "calc/module.cook"; uuid = "64aa3ee1-395d-41c2-9a6b-8acd846f3016"; action = create; usage = source; }, { file_name = "calc/var.cc"; uuid = "04396984-bed1-46f3-93f0-385918d3ec2c"; action = create; usage = source; }, { file_name = "calc/var.h"; uuid = "0ea5463e-8f25-4612-83f5-19097f6c9155"; action = create; usage = source; }, { file_name = "configure.ac.in"; uuid = "551e0b9b-28ae-4e8f-a712-286f6e4c18b1"; action = create; usage = source; }, { file_name = "etc/aedist.cook"; uuid = "24783de6-5dce-4c84-aa0c-c3d3cd46a166"; action = create; usage = source; }, { file_name = "etc/autoconf.cook"; uuid = "cd1ef70a-1699-4504-acb2-787f41249ac8"; action = create; usage = source; }, { file_name = "etc/check-tarball.sh"; uuid = "e4a09f45-92f6-4c71-ae25-c381f423e295"; action = create; usage = source; }, { file_name = "etc/compile.cook"; uuid = "8160a7b7-0500-46ae-9775-fee9a704b91c"; action = create; usage = source; }, { file_name = "etc/lex.cook"; uuid = "8181a42d-e090-4717-a4f6-d25993098368"; action = create; usage = source; }, { file_name = "etc/tarball.cook"; uuid = "e7272629-a893-4555-a70d-7c38c7238d2e"; action = modify; usage = source; }, { file_name = "etc/template/cc"; uuid = "0322fb44-a1dd-4c24-b86b-fd03e15a9c9c"; action = create; usage = source; }, { file_name = "etc/template/cook"; uuid = "b1b685c5-cd17-4356-b597-b5203ed25985"; action = create; usage = source; }, { file_name = "etc/template/generic"; uuid = "f519e222-69bd-4d13-870c-efded42b3855"; action = create; usage = source; }, { file_name = "etc/template/h"; uuid = "95eb7cec-a25d-43af-abd1-45558b196656"; action = create; usage = source; }, { file_name = "etc/template/main"; uuid = "f4197658-c51c-4462-b026-f8a5fd5a7932"; action = create; usage = source; }, { file_name = "etc/template/man"; uuid = "9410e2bd-8197-4064-bb4d-4715b1b8ce4f"; action = create; usage = source; }, { file_name = "etc/template/ms"; uuid = "0bfa822c-476a-4e3d-b484-229bfd1f23b0"; action = create; usage = source; }, { file_name = "etc/template/sh"; uuid = "a21ce055-7d6b-4d64-8242-ced152c41775"; action = create; usage = source; }, { file_name = "etc/template/test"; uuid = "3d91c306-dc80-40c9-adf3-8b86523f11bd"; action = create; usage = source; }, { file_name = "etc/yacc.cook"; uuid = "1ffa1a61-cd9a-49f9-b73f-62ebc70be3d4"; action = create; usage = source; }, { file_name = "lib/format_printf.h"; uuid = "c149028b-6b58-439b-b7f2-b8f28b5f5857"; action = create; usage = source; }, { file_name = "lib/fstrcmp.cc"; uuid = "5d85d481-1b4d-4972-8d14-5ae1809765f3"; action = create; usage = source; }, { file_name = "lib/fstrcmp.h"; uuid = "563704d8-bdaf-48e5-bf05-8ab964baa6bf"; action = create; usage = source; }, { file_name = "lib/gmatch.cc"; uuid = "f8a276a0-6b0c-4895-b6d9-937ec6bf764a"; action = create; usage = source; }, { file_name = "lib/gmatch.h"; uuid = "4c66a0e7-9aa9-4bca-b73a-9e5f10275f84"; action = create; usage = source; }, { file_name = "lib/libdir.cc.in"; uuid = "9a05dd9e-365b-4952-8f5a-687fd1ad5e4e"; action = create; usage = source; }, { file_name = "lib/libdir.h"; uuid = "beececcb-18bf-41e9-9f9b-cae88eb466d0"; action = create; usage = source; }, { file_name = "lib/print_version.cc"; uuid = "b4015135-183b-45f6-b622-9abbaa0c1faf"; action = create; usage = source; }, { file_name = "lib/print_version.h"; uuid = "debf603b-ccd0-49ad-900c-317f37e32b81"; action = create; usage = source; }, { file_name = "lib/progname.cc"; uuid = "6b905ee4-a332-4d76-95f2-6604e1778aa3"; action = create; usage = source; }, { file_name = "lib/progname.h"; uuid = "191c67e7-5c4b-496c-818a-1db3ce53e3ee"; action = create; usage = source; }, { file_name = "lib/rcstring.cc"; uuid = "fffd7a42-0bd3-4574-9739-99ffd68f1e69"; action = create; usage = source; }, { file_name = "lib/rcstring.h"; uuid = "b873d6a6-a586-482f-8ebd-9a36de39bf62"; action = create; usage = source; }, { file_name = "lib/rcstring/accumulator.cc"; uuid = "b0930e9d-fd46-441f-a8d2-a0fa47229752"; action = create; usage = source; }, { file_name = "lib/rcstring/accumulator.h"; uuid = "f816030f-efd0-42c3-8af3-ed1d674aec3c"; action = create; usage = source; }, { file_name = "lib/rcstring/accumulator/pop_front.cc"; uuid = "6b34fdb7-fa8c-4858-9c67-0fafd235a696"; action = create; usage = source; }, { file_name = "lib/rcstring/accumulator/printf.cc"; uuid = "5e128bfa-27f9-4f6a-af87-f5374dad46b9"; action = create; usage = source; }, { file_name = "lib/rcstring/basename.cc"; uuid = "5b34d885-52b5-4757-b362-380f86c320e3"; action = create; usage = source; }, { file_name = "lib/rcstring/bool.cc"; uuid = "71694899-2911-4cca-b038-9b18e0af4acc"; action = create; usage = source; }, { file_name = "lib/rcstring/capitalize.cc"; uuid = "4a472cd2-aa55-4cdb-8eb7-2c8131cf9937"; action = create; usage = source; }, { file_name = "lib/rcstring/catenate.cc"; uuid = "68f78ad6-6e81-4073-9523-accb77c80621"; action = create; usage = source; }, { file_name = "lib/rcstring/clear.cc"; uuid = "e2cc7c5d-57ef-405f-9561-3c1ab89002a4"; action = create; usage = source; }, { file_name = "lib/rcstring/dirname.cc"; uuid = "2af035ba-ad5a-4bd8-87df-6d227aa81ae8"; action = create; usage = source; }, { file_name = "lib/rcstring/downcase.cc"; uuid = "a451db99-fcdd-44e9-80fe-f1a7a765c2a1"; action = create; usage = source; }, { file_name = "lib/rcstring/field.cc"; uuid = "59567de3-4172-477a-bc4b-c8ba3609a174"; action = create; usage = source; }, { file_name = "lib/rcstring/gizzards.cc"; uuid = "c3d0b49d-9f62-49be-a2b9-78f901928644"; action = create; usage = source; }, { file_name = "lib/rcstring/gizzards.h"; uuid = "a8df24f2-4b43-42bb-a9ef-70ea02f9c3d7"; action = create; usage = source; }, { file_name = "lib/rcstring/gmatch.cc"; uuid = "49c6d17d-c754-4725-a2e1-e4e7320dc394"; action = create; usage = source; }, { file_name = "lib/rcstring/identifier.cc"; uuid = "ba00d4b7-bb3d-4656-9d53-bd698e1398fb"; action = create; usage = source; }, { file_name = "lib/rcstring/lead_prefix.cc"; uuid = "2b8c0c87-43ac-40e3-9f68-b96f5066396e"; action = create; usage = source; }, { file_name = "lib/rcstring/list.h"; uuid = "0e2f64c7-e504-4fb1-b772-8c034bf703c0"; action = create; usage = source; }, { file_name = "lib/rcstring/list/appelistuniq.cc"; uuid = "2e634c0a-981b-459d-be4d-801b3d33a3c4"; action = create; usage = source; }, { file_name = "lib/rcstring/list/append.cc"; uuid = "bb61d898-37a8-4b3a-90a5-1ffd8abd848a"; action = create; usage = source; }, { file_name = "lib/rcstring/list/append_list.cc"; uuid = "44e658c5-487c-47db-ab7f-b3ae7352aa36"; action = create; usage = source; }, { file_name = "lib/rcstring/list/append_uniqu.cc"; uuid = "9b803769-07ab-41c4-a138-55082506281e"; action = create; usage = source; }, { file_name = "lib/rcstring/list/assign_op.cc"; uuid = "38cbff7c-2221-40f6-80a1-64fc6a6cae5d"; action = create; usage = source; }, { file_name = "lib/rcstring/list/clear.cc"; uuid = "55f86a8b-c7c1-443b-8101-292409776f1c"; action = create; usage = source; }, { file_name = "lib/rcstring/list/constructor.cc"; uuid = "3d88c2cb-3ec1-49dc-b9dc-6e79df559f11"; action = create; usage = source; }, { file_name = "lib/rcstring/list/copy.cc"; uuid = "ccd01492-99e8-44ce-8308-4cb7c477cf0b"; action = create; usage = source; }, { file_name = "lib/rcstring/list/destructor.cc"; uuid = "61ce2ba2-c73d-4a39-ab16-7eec91a71f5d"; action = create; usage = source; }, { file_name = "lib/rcstring/list/equal.cc"; uuid = "96a69e68-dadc-4a6b-82f5-2db12cb4b11d"; action = create; usage = source; }, { file_name = "lib/rcstring/list/intersection.cc"; uuid = "abfef8ce-650b-421c-b42e-326f86c72cc0"; action = create; usage = source; }, { file_name = "lib/rcstring/list/member.cc"; uuid = "5b9a9f71-d2a8-4df8-88e8-f27b65581ca5"; action = create; usage = source; }, { file_name = "lib/rcstring/list/member_nocas.cc"; uuid = "641436ed-76c2-4543-8977-2cfa7e9ce76f"; action = create; usage = source; }, { file_name = "lib/rcstring/list/pop_back.cc"; uuid = "51e22be7-eba5-46ef-8771-3b5d9f5e138f"; action = create; usage = source; }, { file_name = "lib/rcstring/list/pop_front.cc"; uuid = "0ac7e908-bbe7-4f36-962a-e23d26e3f85e"; action = create; usage = source; }, { file_name = "lib/rcstring/list/prepend.cc"; uuid = "8021a466-63b2-4648-959b-22f44b50770f"; action = create; usage = source; }, { file_name = "lib/rcstring/list/prepend_list.cc"; uuid = "78829fee-9f1c-48c8-8295-cebfb72f8547"; action = create; usage = source; }, { file_name = "lib/rcstring/list/quote.cc"; uuid = "0465f7ca-8bc7-4c5d-9204-5c238cb4866f"; action = create; usage = source; }, { file_name = "lib/rcstring/list/remove.cc"; uuid = "8e3060a3-bace-4759-bdb7-4eaad31302b4"; action = create; usage = source; }, { file_name = "lib/rcstring/list/remove_list.cc"; uuid = "c55cc0bb-313a-4dc0-a702-a47770d79f0b"; action = create; usage = source; }, { file_name = "lib/rcstring/list/sort.cc"; uuid = "a75e883f-724f-439f-89d4-bc8868b8b546"; action = create; usage = source; }, { file_name = "lib/rcstring/list/sort_long_short.cc"; uuid = "ec8bff93-d5d9-40eb-a306-897a79699d7a"; action = create; usage = source; }, { file_name = "lib/rcstring/list/sort_nocase.cc"; uuid = "d3a87fcb-cc6c-475d-9457-efd27007561b"; action = create; usage = source; }, { file_name = "lib/rcstring/list/sort_vers.cc"; uuid = "dbd21c72-a9c0-40b5-8b4b-9d843170c1db"; action = create; usage = source; }, { file_name = "lib/rcstring/list/str2wl.cc"; uuid = "faa5d23c-0af1-451b-ac09-eae81261e522"; action = create; usage = source; }, { file_name = "lib/rcstring/list/subset.cc"; uuid = "b0585b9c-5bef-4139-aab0-34f4aeb6b24c"; action = create; usage = source; }, { file_name = "lib/rcstring/list/validate.cc"; uuid = "eca26455-f1e4-40ea-9d46-57126972d493"; action = create; usage = source; }, { file_name = "lib/rcstring/list/wl2str.cc"; uuid = "57ac76cb-b4b0-470a-840f-4c2a990f9c2c"; action = create; usage = source; }, { file_name = "lib/rcstring/list/xor.cc"; uuid = "284184f8-d161-446f-bb22-1b93ca212cfd"; action = create; usage = source; }, { file_name = "lib/rcstring/long.cc"; uuid = "eebc937d-f721-42a5-979c-064444871b6b"; action = create; usage = source; }, { file_name = "lib/rcstring/printf.cc"; uuid = "f9654b28-9f28-4cd9-8b70-a74e1d1add5a"; action = create; usage = source; }, { file_name = "lib/rcstring/quote.cc"; uuid = "944d162c-3c49-4b18-bcf0-42c02446bbce"; action = create; usage = source; }, { file_name = "lib/rcstring/quote_c.cc"; uuid = "1fb3f0cc-630a-4f94-91b1-7ca50d715473"; action = create; usage = source; }, { file_name = "lib/rcstring/replace.cc"; uuid = "c6d6e7e5-68fe-4a88-a849-c8cb676a9fe2"; action = create; usage = source; }, { file_name = "lib/rcstring/substring.cc"; uuid = "c62d20bf-bbf9-4237-a170-bfaccb33b5da"; action = create; usage = source; }, { file_name = "lib/rcstring/traili_suffi.cc"; uuid = "ebe5eab2-725d-4f34-8a5f-e9f5afee67e3"; action = create; usage = source; }, { file_name = "lib/rcstring/trim.cc"; uuid = "823f38d6-bbfc-4c17-8a51-0ed76ace5d04"; action = create; usage = source; }, { file_name = "lib/rcstring/upcase.cc"; uuid = "8fb44bb5-45e1-490b-b542-05a7c97ecf44"; action = create; usage = source; }, { file_name = "lib/symtab.cc"; uuid = "b94cfa1a-d1d5-4cf2-aebc-771766a114ba"; action = create; usage = source; }, { file_name = "lib/symtab.h"; uuid = "0c3a9759-8042-4991-8433-a9b8a5a096d9"; action = create; usage = source; }, { file_name = "lib/symtab/assign.cc"; uuid = "3b0ebcb6-90f5-4bc7-8736-92da4389567b"; action = create; usage = source; }, { file_name = "lib/symtab/assign_push.cc"; uuid = "2d0b5405-f7f0-4b2a-948b-a3c16474077f"; action = create; usage = source; }, { file_name = "lib/symtab/clear.cc"; uuid = "e4db0462-da25-4598-960d-b8d6ddad79f5"; action = create; usage = source; }, { file_name = "lib/symtab/delete.cc"; uuid = "4440c26b-bc7a-405f-8d19-6c569e94f019"; action = create; usage = source; }, { file_name = "lib/symtab/dump.cc"; uuid = "11ff1e0c-027d-4dca-9738-e7439f43c07e"; action = create; usage = source; }, { file_name = "lib/symtab/keys.cc"; uuid = "2d90e6bc-f56f-4760-98c0-d66e3dd33c89"; action = create; usage = source; }, { file_name = "lib/symtab/query.cc"; uuid = "5082ad06-d0cb-4098-b5b6-4002fc7ec4d6"; action = create; usage = source; }, { file_name = "lib/symtab/query_fuzzy.cc"; uuid = "5e711a75-dbf0-4ef9-8794-45338a196991"; action = create; usage = source; }, { file_name = "lib/symtab/split.cc"; uuid = "80395241-bde7-41f8-a8f4-ad9ca0b5a681"; action = create; usage = source; }, { file_name = "lib/symtab/template.h"; uuid = "f0bae413-563c-418d-8e6a-3728f7d38efe"; action = create; usage = source; }, { file_name = "lib/symtab/valid.cc"; uuid = "153449d4-a727-4699-b892-b46d8746d34b"; action = create; usage = source; }, { file_name = "lib/version.cc"; uuid = "03590bc1-0836-4f18-bc56-df89e84250d3"; action = create; usage = source; }, { file_name = "lib/version.h"; uuid = "ff5948ef-68a4-4b24-b035-4ee98efed9d9"; action = create; usage = source; }, { file_name = "makegen/main.cc"; uuid = "d317de38-2701-4e7d-9850-0ad877284039"; action = remove; usage = source; }, { file_name = "makegen/target.cc"; uuid = "0782593e-29f4-422c-867a-de9573bac35d"; action = remove; usage = source; }, { file_name = "makegen/target.h"; uuid = "733be6cc-a278-433b-a3f6-5dbbf28d13d1"; action = remove; usage = source; }, { file_name = "makegen/target/makefile.cc"; uuid = "364b2d98-2b4c-4938-aadd-d8023b5c2847"; action = remove; usage = source; }, { file_name = "makegen/target/makefile.h"; uuid = "45a85776-8dce-4af9-855a-ccadba5922f9"; action = remove; usage = source; }, { file_name = "test/00/t0001a.sh"; uuid = "d6d76aa5-90c0-47c8-af41-53c9854d25a7"; action = create; usage = test; }, { file_name = "test/00/t0002a.sh"; uuid = "e2504c54-da55-413f-a0e4-f65061f5c6a1"; action = create; usage = test; }, { file_name = "test/00/t0003a.sh"; uuid = "dd9bc3a7-d3d2-49c4-b779-099c47aa344f"; action = create; usage = test; }, { file_name = "test/00/t0004a.sh"; uuid = "d451cce8-325d-4fd0-9cfd-3bc7d351bb4d"; action = create; usage = test; }, ]; 07070100000004000081a400000000000000000000000145d9130000000d9b000000000000000000000000000000000000000f00000000src/Howto.cook /* * It is assumed that the following variables are assigned on the command line: * * project The name of the Aegis project. * change The number of the Aegis change. * version The version of this change * search_path The search path from the development directory back into * the baseline, colon separated. */ #include "functions" default_target: all set default; /* * Ask Aegis for for the name of the project, without any attached * version number. */ project_short = [collect aesub -bl "'${project trunk_name}'" ]; project-minus = [collect aesub -bl "'${project trunk_name}-${project version}'" ]; /* * always remove targets before recreating them */ set unlink; /* * always create directories for targets if they don't yet exist. */ set mkdir; /* * Make sure time mod-time of targets is consistent with the ingredients. * (During integration builds, adjust back agressively.) */ set time-adjust; if [match_mask %1D%2 [version]] then set time-adjust-back; /* * Use file fingerprints to supplement file-modified times. */ set fingerprint; /* ------------------------------------------------------------------------- * Section: Search path * * The aegis search path (colon separated) is turned into a cook * search_list (separate words). */ search_list = .; search_tmp = [tail [split ':' [search_path]]]; search_name = bl; loop { search_dir = [head [search_tmp]]; if [not [search_dir]] then loopstop; search_tmp = [tail [search_tmp]]; if [not [exists [search_name]]] then ln -s [search_dir] [search_name] set clearstat; search_list = [search_list] [search_name]; search_name = [search_name]bl; } /* ------------------------------------------------------------------------- * Section: Utilities * * The include directory defines the interface between the lib/ contents * and the prog/ contents. */ CPPFLAGS = [addprefix "-I" [search_list]]; CXX = g++; CXXFLAGS = -O2 -Werror -Wall -Wextra; LDFLAGS = ; LIBS = -lm; /* ------------------------------------------------------------------------- * Section: Primary Source Files * * Ask Aegis for the manifest of primary source files. * It is almost *never* a good idea to alter this section in any way. * If you are not an experiences Aegis user, do not edit this section. */ project_files = [shell aelpf -p [project] -c [change] --no-usage build]; change_files = [shell aelcf -p [project] -c [change] --no-usage build]; source_files = [sort [project_files] [change_files]]; source_files2 = [fromto %0%.in %0% [source_files]]; /* -------------------------------------------------------------------------- * Section: What to build * * The "all" targets are each of the commands. Note that later includes * will add to the [all] variable contents, and this will be reflected * when the recipe is used. */ all = ; all: [all]; /* * The integration build a little more than the developer build. */ integration-build-targets = ; integration-build-targets: [integration-build-targets]; if [matches %1D%2 [version]] then all += integration-build-targets; /* -------------------------------------------------------------------------- * Section: Additional build instructions */ #include [resolve etc/aedist.cook] #include [resolve etc/autoconf.cook] #include [resolve etc/compile.cook] #include [resolve etc/lex.cook] #include [resolve etc/tarball.cook] #include [resolve etc/yacc.cook] #include [resolve [match_mask %0module.cook [source_files]]] 07070100000005000081a400000000000000000000000145d9130000004643000000000000000000000000000000000000000c00000000src/LICENSE GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. 07070100000006000081a400000000000000000000000145d9130000005a65000000000000000000000000000000000000001000000000src/README.html Example Aegis Project (for C++, using Cook and Aesvt)

Description

This is a template Aegis project. It provides a general and robust framework from which a great number of projects may be formed. It is pre-configured for C++ programs. It is preconfigured to use the GNU GPL as the license and references it in the file headers. It scales to truely huge projects.

If you want to get started using Aegis, this provides a simple and rapid way of setting-up a C++ project.

Download

This template project is distributed in the form of an aedist change set, a special way of packaging an Aegis change.

The project template is in a file called example-c-plus-plus.ae and usually obtained from http://aegis.sourceforge.net/ (or one of its mirrors) using your favorite web browser.

Assumed Environment

In order to follow these instructions, there are several software packages you will need.
  • It is assumed that you have downloaded and installed Aegis according to the instructions. If you haven't, you need to before you can proceed. (You need Aegis 4.21 or later.)

    It is a really really good idea to print a copy of the Aegis User Guide (which describes how Aegis works and how it is used) and the Aegis Reference Manual (which contains all of the man pages). Keep them handy as you work through these instructions, especially if this is your first time.

  • It is assumed that you have downloaded and installed Cook according to the instructions. If you haven't, you need to before you can proceed. (You need Cook 2.8 or later.)

    It's probably a good idea to have to Cook manuals handy, too. They're not essential, but it helps if you're trying to read the Howto.cook file.

  • It is assumed that you have downloaded and installed RCS according to the instructions. This is only necessary for the merge(1) program, which is used to perform 3-way merges of test files. If you have a different preferred merge tool, it's pretty easy to change it later.

  • It is assumed that you have downloaded and installed Bison according to the instructions. (This is optional if your system already as a yacc of some sort.)

  • It is assumed that you have downloaded and installed Flex according to the instructions. (This is optional if your system already as a lex of some sort.)

  • It is assumed that your account is configured appropriately. In particular, you need access to the Aegis aliases. If the command “ael p” gives the error "ael: command not found", then you probably need to add the line
    . /usr/local/lib/aegis/profile
    to the .profile file in your home directory, and reboot. (The actual path may vary, depending on where you installed Aegis.) Many Linux systems do this automagically, by adding a suitable symbolic link at /etc/profile.d/aegis.sh

Creating the Repository

For the best results, as this protects against the greatest number of kinds of accidents, you are recommended to create a separate user account for your repository. Usually, this account has the same name as your project. These instructions assume a user account called “example” and a project also called “example”.

As the example user, you need to execute the following commands. The typical response is shown here also. The first command creates the project.

$ aenpr example
aegis: project "example": created
aegis: project "example.1": created
aegis: project "example.1.0": created
$

The next command adds your normal login as a project administrator, and other development roles. (Your normal login as assumed to be “you” for this example.)

$ aena -p example.1.0 you
aegis: project "example.1.0": user "you" is now an administrator
$ aend -p example.1.0 you
aegis: project "example.1.0": user "you" is now a developer
$ aenrv -p example.1.0 you
aegis: project "example.1.0": user "you" is now a reviewer
$ aeni -p example.1.0 you
aegis: project "example.1.0": user "you" is now an integrator
$

The .forward file of the “example” user needs to be set to someone appropriate to read mail directed at the project.

You can now ask your system administrator to set the “example” user's password field to “*”. This effectively prevents the “example” user from logging in. Aegis is designed to make this unnecessary from now on.

The rest of the commands may be executed under your usual account. By adding your normal account as an administrator, you are now authorized to perform the necessary actions. As an administrator, “you” can add new developers, reviewers, etc, without logging in as the project owner.

You can set a short-cut to the project you are interested in by using the ae_p command to set the AEGIS_PROJECT environment variable:

$ ae_p example.1.0
$

You need to edit the project attributes to reflect your needs. The project attributes are edited using the following command

$ aepa -e
...you are placed into the editor...
$

You will be placed into an editor (controlled by the VISUAL environment variable, or “vi” if it isn't set). You need to edit the attributes file to look like this:

description = "an example project";
developer_may_review = true;
developer_may_integrate = true;
reviewer_may_integrate = true;
developers_may_create_changes = true;
umask = 022;

You should set the description to something appropriate for you project (be very careful about the end quote and semicolon). You will also notice that the staff roles are set for a single-person project. When you decide to tighten things up, you should start by setting developer_may_review = false.

An easier way to do this is to use the tkaepa(1) command. It provides you with a simple GUI to edit the project attributes.

$ tkaepa
...click the OK button when you are done...
$
Will probably want to select the develop end action to be goto awaiting integration, especially of this is you first time using Aegis and there is no second person to do the reviewing for you.

The project is now ready for adding the template project change set you downloaded.

If you need to add more staff to the project, because your normal account is an authorized project administrator, use the aend (et al) commands to do this from your normal account.

Apply the Change-set

The downloaded change set is applied using the following command
$ aedist --rec -f example-c-plus-plus.ae -p example.1.0
...lots of output...
$

You must give the project name on the command line, or aedist will try to use the project name it finds in the change set - and will not find it.

The aedist command will, in turn, issue a number of other commands. These are all normal Aegis commands you could issue yourself, if you were familiar with Aegis. It will, however, stop with a moderately alarming message:

Warning: This change contains files which could host a Trojan horse attack. You should review it before building it or testing it or completing development. This change remains in the being_developed state.
This message comes because in order to build the project, you are going to have to execute a number of commands contained in the project “aegis.conf” file, and in the “Howto.cook” file. For your own protection, aedist stops at this point. You may want to inspect these two files before continuing.

In order to complete development of the change set, you must first build it...

$ aecd
$ aeb
...you will see commands which build the project...
$

There are a number of things that could go wrong at this point...

  • If you don't have Cook installed, the build command (aeb) will fail.
  • If you don't have GNU bison installed, you need to edit the Howto.cook file to use yacc instead. Look for “Section: Using Yacc”, and use the commented-out assignment.
  • If you don't have GNU Flex installed, you need to edit the Howto.cook file to use lex instead. Look for “Section: Using Lex”, and use the commented-out assignments.

Once the change builds, you need to difference it (this is a little redundant for this first command, but you'll see how useful it is later).

$ aed
...you will see commands which "diff" the project...
$

Now you will need to test the change. This is because this change set includes a number of tests for the example programs. They give you an idea of what is meant to happen when developing software using Aegis - none of the tests should fail.

$ aet
...lots of output...
$ aet -bl
...lots of output...
$

The change is now ready to end development.

$ aede
aegis: project "example.1.0": change 10: development complete
$

If you selected the develop end action to be goto awaiting integration then you can skip this next bit, because it talks about the review state that you have configured to project to skip.

The change set is now ready to be reviewed. In a single-person project like this one, you can review your own work. Obviously this is a conflict of interest, and larger projects are usually configured to have Aegis prevent this.

$ aerpass -p example.1.0 -c 10
aegis: project "example.1.0": change 10: review pass
$

The change is now ready to be integrated. Only when integration is complete are the files actually committed to the repository.

$ aeib -p example.1.0 -c 10 
$ aeb
...you will see commands which build the project...
$ aed
...you will see commands which "diff" the project...
$ aet
...lots of output...
$ aet -bl
...lots of output...
$ cd
$ aeipass
...you will see commands committing the files to aesvt...
aegis: project "example.1.0": change 10: integrate pass
$

The “cd” command you see is actually important: you need to be out of the development directory and integration directory so that they can be cleaned up (deleted) when the change completes.

Note that, when you are comfortable using Aegis, it is possible to perform the whole integration stage with a single command, see aeintegratq(1) for more information. You can even run it from cron(8).

Where to from here

If you go this far, your example project is ready for use.

It is strongly suggested that you complete the first change “as is” and perform your own customizations in later changes, rather than trying to get the project started and customize it at the same time.

The rest of this file describes how to perform various common changes to the example project.

Directory Structure

Now that the example project is in a fit state to be worked on, you will need to know where it expects things to be parked.

The directory structure as it presently stands looks something like this (only primary source files are shown):

Howto.cook
include/
	version.h
lib/
	name1/
		source1.c
		version.c
	name2/
		source2.c
man/
	man1/
		progA.1
		progB.1
prog/
	progA/
		main.c
	progB/
		main.c

In addition, the compiled executables are placed under the “bin” directory. This permits, for example, adding the bin directory from the baseline to your command search PATH environment variable.

When a development directory is created for an Aegis change, it is initially empty. However, the Howto.cook file always removes targets before running recipes, this is to ensure the the integration directory (see the Aegis manual) can't damage the baseline.

In order to modify a file, you need to work on a copy, obtained via Aegis using the “aecp” command (named after the “cp” command). This way Aegis knows which files you are modifying. The copy of the file to be modified is placed in the development directory in the same relative location as it appears in the baseline.

Similarly, you create new files using the “aenf” command (it's mnemonic). Again, this way Aegis knows which files you are creating.

Anything which isn't present in the development directory is obtained from the baseline. If there is, for example, an include file in the development directory, the baseline source files will be recompiled and the new object files placed in the development directory.

Whole Project Builds

The method used to build the project is to perform “whole project” builds. For an explanation of advantages of the whole project build concept, you may want to read the Recursive Make Considered Harmful paper.

Adding New Programs

This section assumes that you have taken the initial change set for this template project through to completion, rather than trying to do everything at once. This is important, because some of the instructions below will fail if this isn't the case.

In order to add a new program, you must do one thing.

  1. Two things actually, but everything in Aegis is done within a change, so I won't mention it again. You create a change and begin development of it using the aenc and aedb commands. You go to the newly-created work area using the aecd command.

  2. You need to add the source files of your new program, using the “new file” Aegis command. If the program were called “fred” then you would say
    $ aenf prog/fred/main.c
    $
    or similar. There could be many .c and .h files, and you should create them all. Using your favorite editor, set their contents appropriately. (I'm guessing you have a particular already-working program you are experimenting on.)

  3. The Howto.cook file will notice the new program automatically, provided you put its source files in a directory under the prog directory. You do not need to edit the Howto.cook file to tell it about the new program.

Using the project structure provided by this Aegis project template you can't have the sources to two separate programs in the one directory. If you have two programs with a common portion, see the libraries section, below, for how to manage the common portion.

Aegis wants to know if your program builds, and so it watches the exit status of the cook command. To build your new program, it is only necessary to use the

$ aeb
aegis: cook -b Howto.cook project=example.1.0 change=11
...lots of output...
aegis: project "example.1.0": change 11: development build complete
$
command. This will compile all of the modules and link them to produce the new program. You will find the executable in the “bin” directory.

You may also want to add a test of your new program. This is optional, but it is one of the strengths of the Aegis process.

All that is left is to complete development of the change and to integrate it, using the normal Aegis process.

Adding New Program Modules

If you need to add another module (often a .c file) to an existing program, it is only necessary to add the new source file, viz:
$ aenf prog/fred/gizmo.c prog/fred/gizmo.h
$
The .c file is the implementation, and the .h file is the published API. You should put function prototypes in the .h file, and include it both into the file which defines the function, and into the files which call the function. Edit the new files with your favorite text editor to add the new functionality.

Obviously, to invoke the new functionality, it must be called from somewhere. You copy the necessary file in order to edit it.

$ aecp prog/fred/main.c
$
It is assumed that this file will #include the .h file (to get the function prototype), and somewhere call the new functionality.

The new file is detected automatically, there is no need to edit the Howto.cook file to tell it about the new source file. The include dependencies are managed automatically. There is no need to edit the Howto.cook file to make this happen.

To build the new version your program, it is only necessary to use the

$ aeb
...lots of output...
$
command. This will compile all of the new and changed modules and link them to produce the new version of the program. You will find the executable in the “bin” directory.

You may also want to add a test of your new functionality. This is optional, but it is one of the strengths of the Aegis process.

All that is left is to complete development of the change and to integrate it, using the normal Aegis process.

Adding New Libraries

In order to add a new library, you must do two things.
  1. You need to add the source files of your new library, using the “new file” Aegis command. If the library were called “nurk” then you would say
    $ aenf lib/nurk/func.c
    $
    or similar. Place the include files which define the published API into the include directory...
    $ aenf include/func.h
    $
    (Include files which are internal to the library should be placed below the lib/nurk directory.) There could be many .c and .h files, and you should create them all. Using your favorite editor, set their contents appropriately.

  2. The Howto.cook file will automatically notice the new library, provided you place its source files in a directory leblow the lib directory. You do not need to edit the Howto.cook file to tell it about the new library.

    However, for each program which uses this new library (in the Programs section of the Howto.cook file) you need to add a line of the form

    bin/fred_libs = lib/libnurk.a;

Using the project structure provided by this Aegis project template you can't have the sources to two separate libraries in the one directory.

To build your new library, it is only necessary to use the

$ aeb
...lots of output...
$
command. This will compile all of the modules and archive them to produce the new library. It will then re-build and re-link any programs which need the new library. (Note: if none use it, it won't be compiled and archived!) You will find the executables in the “bin” directory.

You may also want to add a test of your new functionality. This is optional, but it is one of the strengths of the Aegis process.

All that is left is to complete development of the change and to integrate it, using the normal Aegis process.

Adding New Library Modules

If you need to add another module (often a .c file) to an existing library, it is only necessary to add the new source file, viz:
$ aenf lib/nurk/kermit.c include/kermit.h
$
The .c file is the implementation, and the .h file is the published API. You should put function prototypes in the .h file, and include it both into the file which defines the function, and into the files which call the function. Edit the new files with your favorite text editor to add the new functionality.

Obviously, to invoke the new functionality, it must be called from somewhere. You copy the necessary file in order to edit it.

$ aecp prog/fred/main.c
$
It is assumed that this file will #include the .h file (to get the function prototype), and somewhere call the new functionality.

The include dependencies are managed automatically. There is no need to edit the Howto.cook file to make this happen.

To build the new version your program, it is only necessary to use the

$ aeb
...lots of output...
$
command. This will compile all of the new and changed modules and link them to produce the new version of the library. You will find the executable in the “bin” directory.

You may also want to add a test of your new functionality. This is optional, but it is one of the strengths of the Aegis process.

All that is left is to complete development of the change and to integrate it, using the normal Aegis process.

Yacc and Lex

The Howto.cook file included in the project understands yacc and lex. It can even cope with more than one yacc grammar in a program or library. It does this by editing the “yy” symbols to have a prefix based on the filename. (Yes, bison and flex have arguments for this, but this technique works with other yacc and lex implementations, as well.)

Simply add your .y and .l files as you would add any other source file. It will be detected and linked, the same as other sources. 07070100000007000081a400000000000000000000000145d9130000000668000000000000000000000000000000000000000f00000000src/aegis.conf /* * This is the project ``config'' file. It controls many aspects of * how Aegis interacts with your project. * * There are several sections of this file, each dealing with a different * aspect of the interaction between Aegis and the tools used to manage * your project. * * To make the sections obvious, and to allow you to easily replace them * with other choices, a configuration directory is used. Each file * in the configuration directory controls a different aspect of the * configuration (the file names in this directory names are meant to be * descriptive, they aren't hard coded). * * In general, you should be able to take the appropriate files from the * confiuration examples installed with Aegis. This are usually in the * $prefix/share/aegis/config.examples/ directory. */ configuration_directory = "aegis.conf.d"; /* ------------------------------------------------------------------------- * * The integrate_begin_exceptions are files which are not hard linked * from the baseline to the integration directory. In this case, this * is done to ensure the version stamp is updated appropriately. */ integrate_begin_exceptions = [ "lib/version.o", "lib/patchlevel.h" ]; /* ------------------------------------------------------------------------- * * The trojan_horse_suspect field is a list of filename patterns which * indicate files which *could* host a Trojan horse attack. It makes * aedist --receive more cautions. It is NOT a silver bullet: just * about ANY file can host a Trojan, one way or the other. */ trojan_horse_suspect = [ "*.awk", "*.cook", "*.pl", "*.sh", ]; 07070100000008000081a400000000000000000000000145d9130000000a35000000000000000000000000000000000000001700000000src/aegis.conf.d/aesvt /* * This file is in the Public Domain, 2006 Peter Miller. * * Example of using aesvt in the project config file * * The entries for the commands are listed below. The aevst Simple * Version Tool is just about ideal for Aegis to use (well, you'd expect * that, with a name like aesvt). * * Binary files are fully supported. * * The ${quote ...} construct is used to quote filenames which contain * shell special characters. A minimum of quoting is performed, so if * the filenames do not contain shell special characters, no quotes will * be used. */ /* * This command is used to get a specific edit back from history. * This command is always executed as the project owner. * The following substitutions are available: * * ${History} * absolute path of the history file * ${Edit} * edit number, as given by history_\%query_\%command * ${Output} * absolute path of the destination file */ history_get_command = "aesvt -check-out -edit ${quote $edit} " "-history ${quote $history} " "-f ${quote $output}" ; /* * This command is used to add a new "top-most" entry to the history file. * This command is always executed as the project owner. * The following substitutions are available: * * ${Input} * absolute path of source file * ${History} * absolute path of history file * * It is essential that the history_put_command be identical to the * the history_create_command for branching to work correctly. */ history_put_command = "aesvt -check-in " "-history ${quote $history} " "-f ${quote $input} " "Aegis-Version=${quote $version} " "Change-Uuid=${quote ${change uuid}} " "Delta-Uuid=${quote ${change delta_uuid}} " "Description=${quote ${change description}} " "Filename=${quote $filename} " "User=${quote $developer} " ; /* * This command is used to query what the history mechanism calls the top-most * edit of a history file. The result may be any arbitrary string, it need not * be anything like a number, just so long as it uniquely identifies the edit * for use by the history_get_command at a later date. The edit number is to * be printed on the standard output. This command is always executed as the * project owner. * * The following substitutions are available: * * ${History} * absolute path of the history file */ history_query_command = "aesvt -query " "-history ${quote $history}" ; /* * The history_content_limitation field describes the content style * which the history tool is capable of working with. The aesvt tool is * fully capable of hosting binary files. */ history_content_limitation = binary_capable; 07070100000009000081a400000000000000000000000145d9130000000452000000000000000000000000000000000000001600000000src/aegis.conf.d/cook/* * This file is in the Public Domain, 2006 Peter Miller. * This file is part of the Aegis project configuration. * * The build tool is delegated. */ /* * The build_command field of the config file is used to invoke the relevant * build command. The following command tells cook where to find the recipes. * The ${s Howto.cook} expands to a path into the baseline during development * if the file is not in the change. Look in aesub(5) for more information * about command substitutions. */ build_command = "cook -book ${s Howto.cook} search_path=$search_path " "project=$p change=$c version=$v -star -no-log -action -notouch"; /* * The recipes in the User Guide will all remove their targets before * constructing them, which qualifies them to use the following entry in the * config file. The targets MUST be removed first if this field is true, * otherwise the baseline would cease to be self-consistent. * * Fortunately, Cook has a nifty ``set unlink;'' statement which is * placed at the top of the cookbook to do this automatically. */ link_integration_directory = true; 0707010000000a000081a400000000000000000000000145d91300000006a6000000000000000000000000000000000000001600000000src/aegis.conf.d/diff/* * This file is in the Public Domain, 2006 Peter Miller. * This file is part of the Aegis project configuration. */ /* * Compare two files using GNU diff. The -U -1 option produces an output * with inserts and deletes shown line, with the whole file as context. * This is usually superior to -c, as it shows what happened * more clearly (and it takes less space). The -b option could be added * to compare runs of white space as equal. * * This command is used by aed(1) to produce a difference listing when * file in the development directory was originally copied from the * current version in the baseline. * * All of the command substitutions described in aesub(5) are available. * In addition, the following substitutions are also available: * * ${ORiginal} * The absolute path name of a file containing the version * originally copied. Usually in the baseline. * ${Input} * The absolute path name of the edited version of the file. * Usually in the development directory. * ${Output} * The absolute path name of the file in which to write the * difference listing. Usually in the development directory. * * An exit status of 0 means successful, even of the files differ (and * they usually do). An exit status which is non-zero means something * is wrong. (So we need to massage the exit status, because diff does * things a little differently.) * * The non-zero exit status may be used to overload this command with * extra tests, such as line length limits. The difference files must * be produced in addition to these extra tests. */ diff_command = "set +e; diff -U -1 -a ${quote $original} ${quote $input} " "> ${quote $output}; test $? -le 1"; 0707010000000b000081a400000000000000000000000145d91300000006db000000000000000000000000000000000000001700000000src/aegis.conf.d/merge /* * This file is in the Public Domain, 2006 Peter Miller. * This file is part of the Aegis project configuration. */ /* * Compare three files using merge(1) from the RCS paackage. Conflicts * are marked in the output. * * This command is used by aed(1) to produce a difference listing when a file * in the development directory is out of date compared to the current version * in the baseline. * * All of the command substitutions described in aesub(5) are available. * In addition, the following substitutions are also available: * * ${ORiginal} * The absolute path name of a file containing the common ancestor * version of ${MostRecent} and {$Input}. Usually the version originally * copied into the change. Usually in a temporary file. * ${Most_Recent} * The absolute path name of a file containing the most recent version. * Usually in the baseline. * ${Input} * The absolute path name of the edited version of the file. Usually in * the development directory. * ${Output} * The absolute path name of the file in which to write the difference * listing. Usually in the development directory. * * An exit status of 0 means successful, even of the files differ (and they * usually do). An exit status which is non-zero means something is wrong. * * The "merge -L" options are used to specify labels for the baseline and the * development directory, respectively, when conflict lines are inserted * into the result. * The "merge -p" options is used to specify that the results are to be printed * on the standard output. */ merge_command = "set +e; " "merge -p -L baseline -L Historical -L C$c " "${quote $mostrecent} ${quote $original} ${quote $input} " "> ${quote $output}; " "test $? -le 1"; 0707010000000c000081a400000000000000000000000145d913000000048b000000000000000000000000000000000000001a00000000src/aegis.conf.d/template/* * This file is in the Public Domain, 2006 Peter Miller. * This file is part of the Aegis project configuration. */ /* * The new file templates are very handy. They allow all sorts of things * to be se automatically. You need to edit them to add your own name, * and copyright conditions. */ file_template = [ { pattern = [ "*/main.cc" ]; body = "${read_file ${source etc/template/main abs}}"; }, { pattern = [ "*.[yl]", "*.cc" ]; body = "${read_file ${source etc/template/cc abs}}"; }, { pattern = [ "*.cook" ]; body = "${read_file ${source etc/template/cook abs}}"; }, { pattern = [ "*.h" ]; body = "${read_file ${source etc/template/h abs}}"; }, { pattern = [ "test/*/*.sh" ]; body = "${read_file ${source etc/template/test abs}}"; }, { pattern = [ "*.sh" ]; body = "${read_file ${source etc/template/sh abs}}"; }, { pattern = [ "*.man", "*.[12345678]" ]; body = "${read_file ${source etc/template/man abs}}"; }, { pattern = [ "*.so", "*.ms", "*.me" ]; body = "${read_file ${source etc/template/ms abs}}"; }, { pattern = [ "*" ]; body = "${read_file ${source etc/template/generic abs}}"; } ]; 0707010000000d000081a400000000000000000000000145d9130000000355000000000000000000000000000000000000001000000000src/calc/gram.h // // example-c-plus-plus - an example Aegis project // Copyright (C) 2006 Peter Miller // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License, // version 2, as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. // #ifndef CALC_GRAM_H #define CALC_GRAM_H int gram_lex(); int gram_parse(); #endif // CALC_GRAM_H 0707010000000e000081a400000000000000000000000145d9130000000189000000000000000000000000000000000000001000000000src/calc/gram.l %{ #include #include #include %} %% [ \t]+ ; [0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)? { yylval.lv_double = atof(yytext); return DOUBLE; } [a-z] { yylval.lv_int = yytext[0] - 'a'; return NAME; } \n | . return yytext[0]; %% int yywrap(void) { return 1; } 0707010000000f000081a400000000000000000000000145d913000000047b000000000000000000000000000000000000001000000000src/calc/gram.y %{ #include #include #include #include %} %token DOUBLE %token NAME %union { int lv_int; double lv_double; } %type DOUBLE expr %type NAME %left '+' '-' %left '*' '/' %right '^' %right UNARY %{ void gram_error(char *s) { fprintf(stderr, "calc: %s\n", s); } %} %% example : /* empty */ | example command '\n' { fflush(stderr); fflush(stdout); } ; command : expr { printf("%g\n", $1); } | NAME '=' expr { assign($1, $3); } | error ; expr : DOUBLE { $$ = $1; } | NAME { $$ = recall($1); } | '(' expr ')' { $$ = $2; } | '-' expr %prec UNARY { $$ = -$2; } | expr '^' expr { $$ = pow($1, $3); } | expr '*' expr { $$ = $1 * $3; } | expr '/' expr { if ($3 == 0) { yyerror("division by zero"); $$ = 0; } else $$ = $1 / $3; } | expr '+' expr { $$ = $1 + $3; } | expr '-' expr { $$ = $1 - $3; } ; 07070100000010000081a400000000000000000000000145d91300000003d6000000000000000000000000000000000000001100000000src/calc/main.cc #include #include #include #include #include #include static void usage(void) { const char *prog = progname_get(); fprintf(stderr, "Usage: %s [ [ ]]\n", prog); fprintf(stderr, " %s -V\n", prog); exit(1); } int main(int argc, char **argv) { progname_set(argv[0]); char *in = 0; char *out = 0; for (;;) { int c = getopt(argc, argv, "V"); if (c == EOF) break; switch (c) { case 'V': print_version(); return 0; default: usage(); } } switch (argc - optind) { case 2: out = argv[optind + 1]; // Fall through... case 1: in = argv[optind]; break; case 0: break; default: usage(); } if (in && !freopen(in, "r", stdin)) { perror(in); exit(1); } if (out && !freopen(out, "w", stdout)) { perror(out); exit(1); } gram_parse(); return 0; } 07070100000011000081a400000000000000000000000145d9130000000434000000000000000000000000000000000000001500000000src/calc/module.cook /* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ /* * If the relationship between a target and a derived ingredient * appears only in a derived cookbook, it is likely that a clean build * (solely from primary source files) will fail. It is recommended that * relationships such as this be placed in a primary source cookbook. */ cascade calc/gram.lex.cc = calc/gram.yacc.h; 07070100000012000081a400000000000000000000000145d91300000000fb000000000000000000000000000000000000001000000000src/calc/var.cc #include static double memory[26]; void assign(int name, double value) { if (name >= 0 && name < 26) memory[name] = value; } double recall(int name) { if (name >= 0 && name < 26) return memory[name]; return 0; } 07070100000013000081a400000000000000000000000145d913000000007d000000000000000000000000000000000000000f00000000src/calc/var.h #ifndef PROG_CALC_VAR_H #define PROG_CALC_VAR_H void assign(int, double); double recall(int); #endif /* PROG_CALC_VAR_H */ 07070100000014000081a400000000000000000000000145d913000000127a000000000000000000000000000000000000001400000000src/configure.ac.in dnl dnl @PACKAGE_NAME@ dnl dnl # The configure.ac file is produced by substituting @PACKAGE_NAME@ dnl # and @PACKAGE_VERSION@ into the configure.ac.in file. This isn't dnl # just at the head of the file, it also appears further down as dnl # well. This is done so that the configure file will always be dnl # automatically up to date, maintained by the build system. dnl AC_INIT(@PACKAGE_NAME@,@PACKAGE_VERSION@) AC_CONFIG_HEADER(lib/config.h) AC_PROG_CXX AC_PROG_CPP AC_PROG_INSTALL AC_PROG_YACC AC_PROG_LEX AC_PROG_RANLIB AC_MINIX AC_ISC_POSIX AC_CHECK_LIB(m, main) AC_CHECK_PROGS(GROFF, groff roff, groff) AC_CHECK_PROGS(AWK, gawk nawk awk, awk) AC_CHECK_HEADERS(bzlib.h crypt.h curl/curl.h curl/multi.h dce/rpc.h \ dce/uuid.h fcntl.h iso646.h libgettext.h libintl.h limits.h \ locale.h magic.h memory.h mntent.h new.h regex.h rxposix.h \ shadow.h stddef.h stdlib.h string.h sys/clu.h sys/ioctl.h \ sys/prctl.h sys/uuid.h unistd.h uuid.h uuid/uuid.h wchar.h \ wctype.h widec.h zlib.h \ ) AC_CHECK_FUNCS(clu_info crypt curl_easy_strerror curl_multi_strerror \ getpgrp igetspnam initgroups gettext gettimeofday iswctype \ lutime magic_file mbrtowc pathconf prctl regcomp \ rpc_string_free seteuid setlocale setresuid setreuid sighold \ sigrelse sigprocmask snprintf strcasecmp strendcpy strlcat \ strlcpy strncasecmp strerror strftime strsignal strtoul \ strverscmp symlink tcgetpgrp uuid_create uuid_export \ uuid_generate uuid_hash uuid_load uuid_make uuid_to_string \ uuid_unparse vsnprintf wcrtomb wcslen wcswidth wcwidth \ xmlReaderForIO \ ) dnl dnl Test to find a Bourne shell which understands functions dnl AC_MSG_CHECKING([for a Bourne shell which understands functions]) if test "z$SH" = "z"; then if test -f /bin/sh5; then SH=/bin/sh5 else SH=/bin/sh fi fi AC_SUBST(SH) AC_DEFINE_UNQUOTED(CONF_SHELL, ["$SH"], [Set this to be the absolute path of a Bourne shell which understands functions.]) AC_MSG_RESULT($SH) dnl dnl Evaluate some of the variables, to remove ${prefix} references. dnl This way, they can be used in C programs and Roff input. dnl Make sure that the project is mentioned in the libdir and datadir paths; dnl add it if it is not already there. dnl test "x$prefix" = xNONE && prefix="${ac_default_prefix-/usr/local}" test "x$exec_prefix" = xNONE && exec_prefix="$prefix" eval "bindir=$bindir" eval "datadir=$datadir" eval "libdir=$libdir" eval "mandir=$mandir" eval "sharedstatedir=$sharedstatedir" case "$datadir" in */@PACKAGE_NAME@/* | */@PACKAGE_NAME@ ) ;; *) datadir="${datadir}/@PACKAGE_NAME@" ;; esac case "$libdir" in */@PACKAGE_NAME@/* | */@PACKAGE_NAME@ ) ;; *) libdir="${libdir}/@PACKAGE_NAME@" ;; esac case "$sharedstatedir" in */@PACKAGE_NAME@/* | */@PACKAGE_NAME@ ) ;; *) sharedstatedir="${sharedstatedir}/@PACKAGE_NAME@" ;; esac eval "sysconfdir=$sysconfdir" dnl dnl If the soelim program exists, and understands the -I option, dnl arrange for the Makefile to install the .ps files from the dnl documentation source files. dnl if test -n "$SOELIM" then if $SOELIM -I. /dev/null > /dev/null 2>&1 then : nothing else AC_MSG_RESULT([ The $SOELIM program does not understand the -I option. GNU Groff 1.15 or later works correctly. See the BUILDING file for details.]) GROFF= fi fi if test -n "$GROFF" then HAVE_GROFF=yes else HAVE_GROFF=no AC_MSG_RESULT([ The documentation set and manual pages will be formatted and installed if you first install GNU Groff 1.15 or later and then re-run this ./configure script. Remember to use \`\`rm config.cache'' before you do. ]) fi AC_SUBST(HAVE_GROFF) # program prefix is the bit to add to the start of the name if test ${PROGRAM_PREFIX-NONE} != NONE -a ${program_prefix-NONE} != NONE; then PROGRAM_PREFIX=${program_prefix} fi AC_SUBST(PROGRAM_PREFIX) # program suffix is the bit to add to the end of the name (before .exe) if test ${PROGRAM_SUFFIX-NONE} != NONE -a ${program_suffix-NONE} != NONE; then PROGRAM_SUFFIX=${program_suffix} fi AC_SUBST(PROGRAM_SUFFIX) AH_TOP( [#ifndef LIB_CONFIG_H #define LIB_CONFIG_H ]) AH_BOTTOM( [ /* * There is more to do, but we need to insulate it from config.status, * because it screws up the #undef lines. They are all implications of * the above information, so there is no need for you to edit the file, * if you are configuring manually. */ #include #endif // LIB_CONFIG_H]) AC_OUTPUT(Makefile lib/libdir.cc) 07070100000015000081a400000000000000000000000145d9130000000379000000000000000000000000000000000000001400000000src/etc/aedist.cook /* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ all += [project].ae; [project].ae: [source_files] { aedist --send --entire-source -p [project] -c [change] -ndh -naa -o [target]; } 07070100000016000081a400000000000000000000000145d913000000120c000000000000000000000000000000000000001600000000src/etc/autoconf.cook/* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ if [not [defined autoconf]] then autoconf = autoconf; if [not [autoconf]] then autoconf = autoconf; if [not [defined autoheader]] then autoheader = autoheader; if [not [autoheader]] then autoheader = autoheader; /* * The configured files are generated using the config.status script * output by the configure script. Not all of them are essential to a * build, or are already taken care of, and some are not meaningful. */ configured_files1 = [match_mask script/%.in [source_files]] ; configured_files2 = [stringset [match_mask %0%.in [source_files]] - [configured_files1] ]; configured_files = [fromto script/%.in bin/% [configured_files1]] [fromto %0%.in %0% [configured_files2]] ; configured_files = [stringset [configured_files] - Makefile /* only for integration builds */ etc/Howto.conf /* make cook trigger this itself */ lib/config.h etc/configure ]; configured_files: [configured_files]; configure: configure.ac install-sh { /* * unfortunately, * install-sh must be in the current directory */ if [not [exists install-sh]] then ln -s [resolve install-sh] install-sh set clearstat; [autoconf] [resolve configure.ac] > [target]; chmod 755 [target]; } /* * The install-sh script can come from a huge range of places, depending * on what distribution you have installed (or whether you built it from * the tarball). * * Setting the install-sh variable make cook print the intended error * message instead of a syntax error when the install-sh script does * not exist. */ install-sh = ; loop install-sh-maybe = /usr/share/autoconf/install-sh [glob /usr/share/automake*/install-sh] [glob /usr/local/share/autoconf*/install-sh] [glob /usr/local/share/automake*/install-sh] { if [exists [install-sh-maybe]] then { install-sh = [install-sh-maybe]; loopstop; } } if [not [install-sh]] then fail "Can't locate the \"install-sh\" script from GNU automake"; install-sh: [install-sh] { cp [need] [target]; chmod 755 [target]; } config.status: configure install-sh { if [not [exists install-sh]] then ln -s [resolve install-sh] install-sh set clearstat; local flags =; if [defined CXXFLAGS] then flags += CXXFLAGS\=[quote [unsplit " " [CXXFLAGS]]]; if [defined LDFLAGS] then flags += LDFLAGS\=[quote [unsplit " " [LDFLAGS]]]; [unsplit " " CXX\=[quote [unsplit " " [CXX]]] [unsplit " " [flags]] [pathname [resolve configure]] --cache-file\=/dev/null --verbose --no-create --srcdir\=. --sysconfdir\=/etc && rm -f config.log ]; } lib/config.h.in: configure.ac { [autoheader] [resolve configure.ac] > [target]; } %0%.h: %0%.h.in config.status single-thread conftest.subs { if [not [exists [dirname %0%.h]]] then mkdir [dirname %0%.h] set clearstat; /* these 2 env vars control what is generated */ CONFIG_FILES\= CONFIG_HEADERS\=[target]\:[resolve %0%.h.in] sh [resolve config.status]; } %0%: %0%.in config.status set ['if' [not [defined baseline]] 'then' shallow] single-thread conftest.subs { if [not [exists [dirname %0%]]] then mkdir [dirname %0%] set clearstat; /* these 2 env vars control what is generated */ CONFIG_FILES\=[target]\:[resolve %0%.in] CONFIG_HEADERS\= sh [resolve config.status]; /* * Make shell scripts and CGI scripts executable. */ if [or [matches %%.cgi %] [matches %%.sh %]] then chmod a+rx [target]; } configure.ac: configure.ac.in { local project_name = [collect aesub -bl "'${project trunk_name}'"]; local project_version = [collect aesub -bl "'${project version}'"]; sed -e "'s/@PACKAGE_NAME@/"[project_name]"/g'" -e "'s/@PACKAGE_VERSION@/"[project_version]"/g'" [resolve configure.ac.in] > [target]; } Makefile.in: [source_files] { aemakegen [addprefix "--search-path=" [search_list]] [source_files] > [target]; } 07070100000017000081a400000000000000000000000145d9130000000411000000000000000000000000000000000000001900000000src/etc/check-tarball.sh #!/bin/sh # # example-c-plus-plus - an example Aegis project # Copyright (C) 2006 Peter Miller # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111, USA. # # # where to get the distribution tarball from # src_tgz=$1 set -e set -x rm -rf check-tarball-tmp mkdir check-tarball-tmp cd check-tarball-tmp tar xzf $src_tgz cd * ./configure grep 'CXXFLAGS *=' Makefile grep 'LDFLAGS *=' Makefile make du -s -h make sure 07070100000018000081a400000000000000000000000145d9130000001516000000000000000000000000000000000000001500000000src/etc/compile.cook /* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ /* ------------------------------------------------------------------------- * Section: Compile Flags * * If you need to add specific options for a particular .cc file, * use the full name of the file, with a _CXXFLAGS suffix. * (See the C++ recipe, below, for how this is referenced.) */ lib/version.cc_CXXFLAGS = "-D'VERSION=\""[version]"\"'"; /* * If you need to add specific options for a particular .cc file, * use the full name of the file, with a _CXXFLAGS suffix. * (See the C++ recipe, below, for how this is referenced.) */ lib/blahblahblah.cc_CXXFLAGS = -DEXTRA_STUFF; /* ------------------------------------------------------------------------- * Section: The Library * * There is a directory "lib" which contains source files common to all * of the project's programs. The relevant portion of the directory * structure looks like this * * lib/ * lib.a * source.file.1.cc * ... * * The list of the object files to put in the library is determined * automatically from the list of source files. */ lib/lib.a_obj = [patsubst %0%.cc %0%.o [filter lib/%0%.cc [source_files2]]] [patsubst %0%.y %0%.yacc.o [filter lib/%0%.y [source_files]]] [patsubst %0%.l %0%.lex.o [filter lib/%0%.l [source_files]]] ; /* * We can use a single pattern implicit to make all of the libraries. */ lib/lib.a: [lib/lib.a_obj] { ar cq [target] [resolve [need]]; } /* ------------------------------------------------------------------------- * Section: Programs * * For each program, construct the object list for that program. * * The relevant portion of the directory structure looks like this * * progA/ * main.cc * source.file2.cc * ... * progB/ * main.cc * source.file4.cc * ... * bin/ * progA * progB * * The list of programs is determinted automatically from the source files, * and the list of objects for each one. */ programs = [patsubst %1/%0% %1 [filter %1/main.cc [source_files]] ]; loop prog = [programs] { bin/[prog]_obj = [patsubst %0%.cc %0%.o [filter [prog]/%0%.cc [source_files]]] [patsubst %0%.y %0%.yacc.o [filter [prog]/%0%.y [source_files]]] [patsubst %0%.l %0%.lex.o [filter [prog]/%0%.l [source_files]]] lib/lib.a ; } /* * We can use a single pattern recipe to make all of the programs. * * All of the programs are built in the development directory all of * the time (that's what "shallow" means) even though wall the object * files can come from the baseline, because the tests always need the * executables. */ bin/%: [defined-or-null [target]_obj] set shallow if [defined [target]_obj] { [CXX] -o [target] [LDFLAGS] [resolve [need]] [LIBS]; } all += [addprefix "bin/" [programs]]; /* -------------------------------------------------------------------------- * Section: Compiling C++ Source Files */ %0%.o: %0%.cc single-thread %.o { local cxxflags = [CXXFLAGS] [defined-or-null %0%.cc_CXXFLAGS] [defined-or-null [dir %0%.cc]_CXXFLAGS] ; if [matches %%.lex.cc %.cc] then cxxflags = [stringset [cxxflags] - -Werror]; [CXX] [cxxflags] [CPPFLAGS] -c [resolve %0%.cc] ['if' [in g++ [CXX]] 'then' -o [target]]; if %0 then if [not [in g++ [CXX]]] then mv %.o [target]; } /* force this one to be shallow */ if [not [exists lib/version.o]] then lib/version.o: .; /* -------------------------------------------------------------------------- * Section: Maintaining C++ Include Dependencies * * How to manage C++ include dependencies, straight out of the Cook manual. */ %0%.cc.d: %0%.cc set no-cascade { c_incl -nc -ns -eia -nrec -nsri /* essential for Aegis development */ [filter -I%%0%% [CPPFLAGS]] -prefix "'cascade %0%.cc ='" -suffix "';'" [resolve %0%.cc] [addprefix -rlp\= [search_list]] -o [target]; } #include-cooked-nowarn [addsuffix ".d" [filter %0%.cc [source_files2]]] %0%.h.d: %0%.h set no-cascade { c_incl -nc -ns -eia -nrec -nsri /* essential for Aegis development */ [filter -I%%0%% [CPPFLAGS]] -prefix "'cascade %0%.h ='" -suffix "';'" [resolve %0%.h] [addprefix -rlp\= [search_list]] -o [target]; } #include-cooked-nowarn [addsuffix ".d" [filter %0%.h [source_files2]]] /* * The version stamp is to be updated for every * integration and development build. */ lib/patchlevel.h: set shallow { aesub "'#define PATCHLEVEL \"${version}\"'" > [target]; aesub "'#define COPYRIGHT_YEARS \"${copyright_years}\"'" >> [target]; aesub "'#define COPYRIGHT_OWNER \"${copyright_owner}\"'" >> [target]; } cascade lib/version.cc = lib/patchlevel.h; 07070100000019000081a400000000000000000000000145d9130000000579000000000000000000000000000000000000001100000000src/etc/lex.cook /* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ /* -------------------------------------------------------------------------- * Section: Using Lex Source Files * * How to have lex read .l files and generate a .lex.cc file. * This section allows you to have more than one lex file in a program * (or library) by editing the generated "yy" identifiers into something * more unique. */ /* lex = lex; */ lex = flex; lex_flags = ; /* LIBS += -ll; */ LIBS += -lfl; %0%.lex.cc: %0%.l single-thread lex.yy.c { [lex] [lex_flags] [resolve %0%.l]; sed -e "'s|[yY][yY]|%_|g'" lex.yy.c > %0%.lex.cc; rm lex.yy.c; } #include-cooked [patsubst %0%.l %0%.lex.cc.d [filter %0%.l [source_files]]] 0707010000001a000081a400000000000000000000000145d9130000000530000000000000000000000000000000000000001500000000src/etc/tarball.cook /* * example-c-plus-plus - an example Aegis project * Copyright (C) 2006 Peter Miller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ integration-build-targets += [project-minus].tar.gz; tarball_files = [source_files] Makefile.in configure install-sh lib/config.h.in lib/patchlevel.h ; [project-minus].tar.gz: [tarball_files] { /* The -h option says to follow symlinks. */ tar -c -h -f - [resolve [tarball_files]] | tardy -unu 0 -gnu 0 -p [project-minus] -ms 0644 -mc 07022 -now [prepost "-rp=" "" [search_list]] | gzip -9 > [target]; } check-tarball: [project-minus].tar.gz { sh [resolve etc/check-tarball.sh] [pathname [resolve [project-minus].tar.gz]]; } 0707010000001b000081a400000000000000000000000145d9130000000581000000000000000000000000000000000000001400000000src/etc/template/cc // // ${project trunk_name} - ${project trunk_description} // Copyright (C) ${date %Y} ${copyright_owner} // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License, // version 2, as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free // Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, // MA 02111, USA. // #include <${trim_ext $fn}.h> ${id ${trim_dir ${trim_ext $fn}}}::~${id ${trim_dir ${trim_ext $fn}}}() { } ${id ${trim_dir ${trim_ext $fn}}}::${id ${trim_dir ${trim_ext $fn}}}() : ${id ${trim_dir ${dirname_rel $fn}}}() { } ${id ${trim_dir ${trim_ext $fn}}}::${id ${trim_dir ${trim_ext $fn}}}(const ${id ${trim_dir ${trim_ext $fn}}} &arg) : ${id ${trim_dir ${dirname_rel $fn}}}(arg) { } ${id ${trim_dir ${trim_ext $fn}}} & ${id ${trim_dir ${trim_ext $fn}}}::operator=(const ${id ${trim_dir ${trim_ext $fn}}} &arg) { if (this != &arg) { ${id ${trim_dir ${dirname_rel $fn}}}::operator=(arg); ... } return *this; } 0707010000001c000081a400000000000000000000000145d91300000002f9000000000000000000000000000000000000001600000000src/etc/template/cook/* * ${project trunk_name} - ${project trunk_description} * Copyright (C) ${date %Y} ${copyright_owner} * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111, USA. */ 0707010000001d000081a400000000000000000000000145d91300000002e6000000000000000000000000000000000000001900000000src/etc/template/generic # # ${project trunk_name} - ${project trunk_description} # Copyright (C) ${date %Y} ${copyright_owner} # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111, USA. # 0707010000001e000081a400000000000000000000000145d91300000005ee000000000000000000000000000000000000001300000000src/etc/template/h // // ${project trunk_name} - ${project trunk_description} // Copyright (C) ${date %Y} ${copyright_owner} // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License, // version 2, as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. // #ifndef ${id ${upcase $fn}} #define ${id ${upcase $fn}} #include <${dirname_rel $fn}.h> /** * The ${id ${trim_dir ${trim_ext $fn}}} class is used to represent */ class ${id ${trim_dir ${trim_ext $fn}}}: public ${id ${trim_dir ${dirname_rel $fn}}} { public: /** * The destructor. */ virtual ~${id ${trim_dir ${trim_ext $fn}}}(); /** * The default constructor. */ ${id ${trim_dir ${trim_ext $fn}}}(); /** * The copy constructor. */ ${id ${trim_dir ${trim_ext $fn}}}(const ${id ${trim_dir ${trim_ext $fn}}} &); /** * The assignment operator. */ ${id ${trim_dir ${trim_ext $fn}}} &operator=(const ${id ${trim_dir ${trim_ext $fn}}} &); }; #endif // ${id ${upcase $fn}} 0707010000001f000081a400000000000000000000000145d9130000000562000000000000000000000000000000000000001600000000src/etc/template/main// // ${project trunk_name} - ${project trunk_description} // Copyright (C) ${date %Y} ${copyright_owner} // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License, // version 2, as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free // Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, // MA 02111, USA. // #include #include #include #include #include static void usage() { const char *prog = progname_get(); fprintf(stderr, "Usage: %s [