Initial release

This commit is contained in:
Pierre Pronchery 2005-08-28 11:45:29 +00:00
commit 1b47027612
5 changed files with 92 additions and 0 deletions

14
Makefile Normal file
View File

@ -0,0 +1,14 @@
SUBDIRS = src
all: subdirs
subdirs:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done
clean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
distclean: clean
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done

1
project.conf Normal file
View File

@ -0,0 +1 @@
subdirs=src

27
src/Makefile Normal file
View File

@ -0,0 +1,27 @@
TARGETS = Init
CFLAGSF = -W -Wall -ansi -I /System/Include
CFLAGS = -g
LDFLAGSF= -L /System/Libraries -l System
CC = cc
AR = ar rc
RANLIB = ranlib
LD = ld -shared
RM = rm -f
all: $(TARGETS)
Init_OBJS= init.o
Init_CFLAGS=$(CFLAGSF) $(CFLAGS)
Init: $(Init_OBJS)
$(CC) $(LDFLAGSF) $(LDFLAGS) -o Init $(Init_OBJS)
init.o: init.c
$(CC) $(Init_CFLAGS) -c init.c
clean:
$(RM) $(Init_OBJS)
distclean: clean
$(RM) $(TARGETS)

42
src/init.c Normal file
View File

@ -0,0 +1,42 @@
/* init.c */
#include <System.h>
#include <stdio.h>
/* Init */
static int _init(void)
{
Event * event;
AppServer * appserver;
if((event = event_new()) == NULL)
return 1;
if((appserver = appserver_new_event("Init", event)) == NULL)
{
event_delete(event);
return 1;
}
for(;;)
event_loop(event);
return 0;
}
/* usage */
static int _init_usage(void)
{
fprintf(stderr, "%s", "Usage: Init\n");
return 1;
}
/* main */
int main(int argc, char * argv[])
{
if(argc != 1)
return _init_usage();
return _init() == 0 ? 0 : 2;
}

8
src/project.conf Normal file
View File

@ -0,0 +1,8 @@
targets=Init
cflags_force=-W -Wall -ansi -I /System/Include
cflags=-g
ldflags_force=-L /System/Libraries -l System
[Init]
type=binary
sources=init.c