diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-02-18 14:58:34 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-03-03 09:07:41 +0100 |
commit | b7077766f68192856f325a30887fba120b612597 (patch) | |
tree | 9d1d7d04137a426c54fa235b29c35f8dc1d0371b | |
parent | 5aa470b224f26af1d6305b710a0a60acc274e717 (diff) | |
download | ptxdist-b7077766f68192856f325a30887fba120b612597.tar.gz ptxdist-b7077766f68192856f325a30887fba120b612597.tar.xz |
[template-src-make-prog] reanimate plain makefile target
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 5 | ||||
-rw-r--r-- | rules/templates/kconfig/Makefile | 19 | ||||
-rw-r--r-- | rules/templates/src-make-prog/@name@.c | 9 | ||||
-rw-r--r-- | rules/templates/src-make-prog/Makefile | 24 | ||||
-rw-r--r-- | rules/templates/src-make-prog/wizard.sh | 21 | ||||
-rw-r--r-- | rules/templates/template-src-make-prog-in | 7 | ||||
-rw-r--r-- | rules/templates/template-src-make-prog-make | 109 |
7 files changed, 173 insertions, 21 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 5e99c2cb6..89004d878 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1000,7 +1000,7 @@ newpackage() { template=template-src-autoconf ;; - src-cmake-prog|src-linux-driver|src-stellaris) + src-cmake-prog|src-linux-driver|src-make-prog|src-stellaris) #template: default #template_src: default ;; @@ -1019,6 +1019,7 @@ newpackage() { echo " src-autoconf-proglib create autotoolized binary+library" echo " src-cmake-prog create cmake binary" echo " src-linux-driver create a linux kernel driver" + echo " src-make-prog create a plain makefile binary" echo " src-stellaris create stellaris firmware" echo " font" echo " simple" @@ -1066,7 +1067,7 @@ newpackage() { # local version case "${action}" in - *-existing-target) + *-existing-target|src-make-prog) ;; *) echo -n "${PROMPT}enter version number.....: " diff --git a/rules/templates/kconfig/Makefile b/rules/templates/kconfig/Makefile deleted file mode 100644 index e61ec9210..000000000 --- a/rules/templates/kconfig/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Simple development makefile -# -.PHONY: all install clean - -all: my_executable - -CFLAGS=-Werror -Wall -Wsign-compare - -my_executable: my_source.c - -clean: - rm -f my_executable - -install: - -# -# end of development makefile -# diff --git a/rules/templates/src-make-prog/@name@.c b/rules/templates/src-make-prog/@name@.c new file mode 100644 index 000000000..58c62ea9e --- /dev/null +++ b/rules/templates/src-make-prog/@name@.c @@ -0,0 +1,9 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char *argv[]) +{ + printf("Hello World, I'm @name@!\n"); + + exit(EXIT_SUCCESS); +} diff --git a/rules/templates/src-make-prog/Makefile b/rules/templates/src-make-prog/Makefile new file mode 100644 index 000000000..57ee6b917 --- /dev/null +++ b/rules/templates/src-make-prog/Makefile @@ -0,0 +1,24 @@ +# +# Simple development makefile +# + +# +# add more flags here, +# but don't remove the "+=" +# +CFLAGS += -O2 -g -Wall #-Wsign-compare -Wfloat-equal -Wformat-security #-Werror +CPPFLAGS += +LDFLAGS += + + +all: @name@ + +clean: + -rm -f @name@ + +install: + + +.PHONY: all install clean + +# end of development makefile diff --git a/rules/templates/src-make-prog/wizard.sh b/rules/templates/src-make-prog/wizard.sh new file mode 100644 index 000000000..f37fe6b51 --- /dev/null +++ b/rules/templates/src-make-prog/wizard.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +HERE=$(pwd) + +NAME=$1 +if [ -z "$NAME" ]; then + echo -n "project name: " + read NAME +fi +NAME_UP=$(echo $NAME | tr '[a-z-]' '[A-Z_]') + +mv "@name@.c" "${NAME}.c" + +for i in \ + Makefile \ + ${NAME}.c \ +; do + sed -i -e "s/\@name\@/${NAME}/g" $i + sed -i -e "s/\@NAME\@/${NAME_UP}/g" $i +done + diff --git a/rules/templates/template-src-make-prog-in b/rules/templates/template-src-make-prog-in new file mode 100644 index 000000000..6dafda51e --- /dev/null +++ b/rules/templates/template-src-make-prog-in @@ -0,0 +1,7 @@ +## SECTION=fixme + +config @PACKAGE@ + tristate + prompt "@package@" + help + FIXME diff --git a/rules/templates/template-src-make-prog-make b/rules/templates/template-src-make-prog-make new file mode 100644 index 000000000..72c4f96d4 --- /dev/null +++ b/rules/templates/template-src-make-prog-make @@ -0,0 +1,109 @@ +# -*-makefile-*- +# +# Copyright (C) @YEAR@ by @AUTHOR@ +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_@PACKAGE@) += @package@ + +# +# Paths and names +# +@PACKAGE@ := @package@ +@PACKAGE@_URL := file://local_src/$(@PACKAGE@) +@PACKAGE@_DIR := $(BUILDDIR)/$(@PACKAGE@) +@PACKAGE@_LICENSE := unknown + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.get: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.extract: + @$(call targetinfo) + @$(call clean, $(@PACKAGE@_DIR)) + @$(call extract, @PACKAGE@) + @$(call patchin, @PACKAGE@) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +@PACKAGE@_PATH := PATH=$(CROSS_PATH) +@PACKAGE@_ENV := $(CROSS_ENV) + +$(STATEDIR)/@package@.prepare: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.compile: + @$(call targetinfo) + cd $(@PACKAGE@_DIR) && \ + $(@PACKAGE@_ENV) $(@PACKAGE@_PATH) $(MAKE) #$(PARALLELMFLAGS) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.install: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.targetinstall: + @$(call targetinfo) + + @$(call install_init, @package@) + @$(call install_fixup, @package@,PACKAGE,@packagedash@) + @$(call install_fixup, @package@,PRIORITY,optional) + @$(call install_fixup, @package@,VERSION,0) + @$(call install_fixup, @package@,SECTION,base) + @$(call install_fixup, @package@,AUTHOR,"@AUTHOR@") + @$(call install_fixup, @package@,DEPENDS,) + @$(call install_fixup, @package@,DESCRIPTION,missing) + +# +# TODO: Add here all files that should be copied to the target +# Note: Add everything before(!) call to macro install_finish +# + @$(call install_copy, @package@, 0, 0, 0755, $(@PACKAGE@_DIR)/@package@, /usr/bin/@package@) + @$(call install_copy, @package@, 0, 0, 0755, $(@PACKAGE@_DIR)/foobar, /dev/null) + + @$(call install_finish, @package@) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +$(STATEDIR)/@package@.clean: + @$(call targetinfo) + @-cd $(@PACKAGE@_DIR) && \ + $(@PACKAGE@_ENV) $(@PACKAGE@_PATH) $(MAKE) clean + @$(call clean_pkg, @PACKAGE@) + +# vim: syntax=make |