Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:helloworld:chapter3 [2018/04/16 10:02] – [Conclusion] armand2 | docs:guide-developer:helloworld:chapter3 [2023/04/11 09:24] (current) – Add warning about code editors converting tab to spaces in Makefile. Changed the previous sentence as I have changed the Makefile to use hard tabs itself and reader doesn't need to edit it anymore astro | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Creating a package from your application ====== | ====== Creating a package from your application ====== | ||
| - | This is the third chapter in the " | + | This is the third chapter in the " |
| * Commissioned your development environment | * Commissioned your development environment | ||
| * Prepared, configured and built the tools and the cross-compilation toolchain | * Prepared, configured and built the tools and the cross-compilation toolchain | ||
| Line 13: | Line 13: | ||
| ===== Creating a package feed for your packages ===== | ===== Creating a package feed for your packages ===== | ||
| - | The LEDE build system revolves heavily around the concept of packages. They are the bread and butter of the system. No matter the software, there' | + | The OpenWrt |
| Due to this package-oriented nature, it is only logical to utilize the same approach for the " | Due to this package-oriented nature, it is only logical to utilize the same approach for the " | ||
| Line 27: | Line 27: | ||
| ===== Creating the package manifest file ===== | ===== Creating the package manifest file ===== | ||
| - | Each package in the LEDE build system is described by a package manifest file. The manifest file is responsible for describing the package, what it does, and must at least provide instructions on where to obtain the source code, how to build it and which files should be contained in the final installable package. A package manifest may additionally contain options for optional configuration scripts, specify dependencies between packages and so on. | + | Each package in the OpenWrt |
| In order for the source code of our application to become a package, and become a part of the package repository that we previously created, we will need to create a package manifest for it: | In order for the source code of our application to become a package, and become a part of the package repository that we previously created, we will need to create a package manifest for it: | ||
| Line 35: | Line 35: | ||
| </ | </ | ||
| - | Using your favorite text editor, enter the following text as the content of the package manifest. Note that several sections of this file are used by the build system' | + | Using your favorite text editor, enter the following text as the content of the package manifest. Note that several sections of this file are used by the build system' |
| <code - makefile> | <code - makefile> | ||
| include $(TOPDIR)/ | include $(TOPDIR)/ | ||
| Line 66: | Line 66: | ||
| # The last command is necessary to ensure our preparation instructions remain compatible with the patching system. | # The last command is necessary to ensure our preparation instructions remain compatible with the patching system. | ||
| define Build/ | define Build/ | ||
| - | | + | mkdir -p $(PKG_BUILD_DIR) |
| - | cp $(SOURCE_DIR)/ | + | cp $(SOURCE_DIR)/ |
| - | $(Build/ | + | $(Build/ |
| endef | endef | ||
| # Package build instructions; | # Package build instructions; | ||
| define Build/ | define Build/ | ||
| - | | + | $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ |
| - | $(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/ | + | $(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/ |
| endef | endef | ||
| # Package install instructions; | # Package install instructions; | ||
| define Package/ | define Package/ | ||
| - | | + | $(INSTALL_DIR) $(1)/ |
| - | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ | + | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ |
| endef | endef | ||