Simple GNU Make–based starter project that builds a tiny C application.
main.c(andtemplate.c) currently implement a basicmain()that printsHello World!.template.hprovides the scaffolding for future shared declarations.Makefiledrives the build, keeping outputs underbuild/.
- Run
maketo compile everything; the default target producesbuild/demousinggccwith debug info. make cleanremoves thebuild/directory.
- After building, execute
./build/demoto see theHello World!output.
Makefile: configurable compiler flags, include paths, and build directory.main.c: application entry point and public includes.template.c/template.h: example module structure to expand upon.
- 本项目使用 GNU Make 构建,目标是生成一个简单的 C 应用程序。
main.c与template.c目前都实现了一个打印Hello World!的main()。template.h提供头文件模板,用于后续共享声明。- 所有编译输出都放在
build/目录下,由Makefile统一管理。
- 执行
make生成build/demo,默认使用带调试信息的gcc。 make clean会清理build/目录。
- 构建完成后运行
./build/demo查看输出。
Makefile:可配置的编译器标志、包含路径和输出目录。main.c:程序入口与公共包含部分。template.c/template.h:预留的模块结构,可据此扩展功能。