Automatically generating Init.h

This commit is contained in:
Pierre Pronchery 2009-11-27 21:40:50 +00:00
parent 568b2dcf50
commit 215471a8fa
8 changed files with 38 additions and 55 deletions

View File

@ -23,13 +23,13 @@ dist:
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz \
$(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/Init.interface \
$(PACKAGE)-$(VERSION)/data/Init.h \
$(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/src/init.c \
$(PACKAGE)-$(VERSION)/src/main.c \
$(PACKAGE)-$(VERSION)/src/service.c \
$(PACKAGE)-$(VERSION)/src/session.c \
$(PACKAGE)-$(VERSION)/src/Makefile \
$(PACKAGE)-$(VERSION)/src/appbroker.sh \
$(PACKAGE)-$(VERSION)/src/common.h \
$(PACKAGE)-$(VERSION)/src/init.h \
$(PACKAGE)-$(VERSION)/src/service.h \

View File

@ -1,44 +0,0 @@
/* $Id$ */
#ifndef Init_H
# define Init_H
# include <stdint.h>
# include <System.h>
/* types */
typedef Buffer * BUFFER;
typedef int16_t INT16;
typedef int32_t INT32;
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef String const * STRING;
typedef BUFFER BUFFER_IN;
typedef INT32 INT32_IN;
typedef UINT32 UINT32_IN;
typedef STRING STRING_IN;
typedef Buffer * BUFFER_OUT;
typedef int32_t * INT32_OUT;
typedef uint32_t * UINT32_OUT;
typedef String ** STRING_OUT;
typedef Buffer * BUFFER_INOUT;
typedef int32_t * INT32_INOUT;
typedef uint32_t * UINT32_INOUT;
typedef String ** STRING_INOUT;
/* functions */
UINT16 Init_login(STRING username);
UINT16 Init_logout();
UINT16 Init_register(STRING, UINT16);
UINT16 Init_get_session(STRING);
INT32 Init_get_profile(STRING_OUT profile);
INT32 Init_set_profile(STRING profile);
#endif /* !Init_H */

View File

@ -1,4 +1,4 @@
dist=Makefile,Init.interface,Init.h
dist=Makefile,Init.interface
[Init.interface]
install=$(PREFIX)/etc/AppInterface

View File

@ -1,9 +1,9 @@
TARGETS = Init
TARGETS = ../data/Init.h Init
PREFIX = /usr/local
DESTDIR =
BINDIR = $(PREFIX)/bin
CC = cc
CPPFLAGSF= -I ../data -I $(PREFIX)/include
CPPFLAGSF= -I $(PREFIX)/include
CPPFLAGS=
CFLAGSF = -W -Wall -pedantic
CFLAGS = -g -O2
@ -16,6 +16,9 @@ INSTALL = install
all: $(TARGETS)
../data/Init.h:
./appbroker.sh "../data/Init.h"
Init_OBJS = init.o main.o service.o session.o
Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
Init_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
@ -36,7 +39,7 @@ session.o: session.c
$(CC) $(Init_CFLAGS) -c session.c
clean:
$(RM) $(Init_OBJS)
$(RM) $(../data/Init.h_OBJS) $(Init_OBJS)
distclean: clean
$(RM) $(TARGETS)

20
src/appbroker.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#$Id$
#usage
usage()
{
echo "Usage: ./appbroker.sh target" 1>&2
return 1
}
#main
if [ $# -ne 1 ]; then
usage
exit $?
fi
APPINTERFACE="${1%%.h}.interface"
AppBroker -o "$1" "$APPINTERFACE"

View File

@ -21,8 +21,8 @@
# include <stdio.h>
#endif
#include "session.h"
#include "../data/Init.h"
#include "init.h"
#include "Init.h"
/* Init */

View File

@ -1,5 +1,5 @@
/* $Id$ */
/* Copyright (c) 2008 Pierre Pronchery <khorben@defora.org> */
/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS System Init */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -59,7 +59,7 @@ static int _init(char const * profile)
/* usage */
static int _usage(void)
{
fputs("Usage: Init -s [-P profile]\n"
fputs("Usage: " PACKAGE " -s [-P profile]\n"
" -P Profile to load\n"
" -s Force the single-user profile\n", stderr);
return 1;

View File

@ -1,9 +1,13 @@
targets=Init
cppflags_force=-I ../data -I $(PREFIX)/include
targets=../data/Init.h,Init
cppflags_force=-I $(PREFIX)/include
cflags_force=-W -Wall -pedantic
cflags=-g -O2
ldflags_force=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib -lSystem -Wl,--export-dynamic
dist=Makefile,common.h,init.h,service.h,session.h
dist=Makefile,appbroker.sh,common.h,init.h,service.h,session.h
[../data/Init.h]
type=script
script=./appbroker.sh
[Init]
type=binary