ObjFW  Check-in [c70b66a228]

Overview
Comment:Add objfw-new

objfw-new creates new source files from templates.

For now, this only has the boilerplate for an empty class and an empty
application, but will be extended over time.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c70b66a22872d295816944e2044dd34eaf826c1d409f429553cf76c972da6cb6
User & Date: js on 2017-06-04 16:05:48
Other Links: manifest | tags
Context
2017-06-04
16:42
objfw-config: Fix a typo check-in: 2704a412cb user: js tags: trunk
16:05
Add objfw-new check-in: c70b66a228 user: js tags: trunk
01:30
OFLocalization: Add support for MorphOS + libnix check-in: d974e769c5 user: js tags: trunk
Changes

Modified utils/Makefile from [66bf0f7ed1] to [e5221f687b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
include ../extra.mk

SUBDIRS += ${OFHASH}	\
	   ${OFHTTP}	\
	   ${OFZIP}

include ../buildsys.mk

DISTCLEAN = objfw-config

install-extra: objfw-config objfw-compile
	for i in objfw-config objfw-compile; do \
		${INSTALL_STATUS}; \
		if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
			${INSTALL_OK}; \
		else \
			${INSTALL_FAILED}; \
		fi \
	done

uninstall-extra:
	for i in objfw-config objfw-compile; do \
		if test -f ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
			if rm -f ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
				${DELETE_OK}; \
			else \
				${DELETE_FAILED}; \
			fi \
		fi \










|
|









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
include ../extra.mk

SUBDIRS += ${OFHASH}	\
	   ${OFHTTP}	\
	   ${OFZIP}

include ../buildsys.mk

DISTCLEAN = objfw-config

install-extra: objfw-config objfw-compile objfw-new
	for i in objfw-config objfw-compile objfw-new; do \
		${INSTALL_STATUS}; \
		if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
			${INSTALL_OK}; \
		else \
			${INSTALL_FAILED}; \
		fi \
	done

uninstall-extra:
	for i in objfw-config objfw-compile objfw-new; do \
		if test -f ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
			if rm -f ${DESTDIR}${bindir}/${BIN_PREFIX}$$i; then \
				${DELETE_OK}; \
			else \
				${DELETE_FAILED}; \
			fi \
		fi \

Added utils/objfw-new version [c18da52b55].





















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

show_help() {
	echo "Usage: objfw-new app|class name"
	exit 1
}

already_exists() {
	echo "$1 already exists! Aborting..."
	exit 1
}

type="$1"
name="$2"

test -z "$name" && show_help

case "$1" in
	app)
		test -f "$name.m" && already_exists "$name.m"

		cat >"$name.m" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject <OFApplicationDelegate>
@end

OF_APPLICATION_DELEGATE($name)

@implementation $name
- (void)applicationDidFinishLaunching
{
	[OFApplication terminate];
}
@end
__EOF__
		;;
	class)
		test -f "$name.h" && already_exists "$name.h"
		test -f "$name.m" && already_exists "$name.m"

		cat >"$name.h" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject
@end
__EOF__
		cat >"$name.m" <<__EOF__
#import "$name.h"

@implementation $name
@end
__EOF__
		;;
	*)
		show_help
		;;
esac