Add Copyright notice

Clean up Makefiles
master
mark 20 years ago
parent 59668ba6c9
commit 8d084e7338

@ -1,15 +1,10 @@
CFLAGS = $(WARNINGS) $(DEFINES) $(INCLUDES)
WARNINGS = -W -Wall
#DEFINES = -D_XOPEN_SOURCE=600
INCLUDES = -I$(LUA)/include
LUA = /home/mark/src/lang/lua/lua-5.1-rc1
default:; echo Choose platform: mingw cygwin posix
default:; @echo Choose a platform: mingw cygwin linux
all: mingw cygwin
mingw:; $(MAKE) -C w32api ex.dll
cygwin:; $(MAKE) -C posix ex.dll
posix:; $(MAKE) -C posix ex.so
cygwin:; $(MAKE) -C posix T=ex.dll ex.dll
linux:; $(MAKE) -C posix ex.so
#"EX_LIB=ex.so" "DEFINES=-D_XOPEN_SOURCE=600"
clean:
$(MAKE) -C posix clean
$(MAKE) -C w32api clean

@ -1,3 +1,7 @@
"ex" API implementation
http://lua-users.org/wiki/ExtensionProposal
Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
-- Environment
os.getenv(name) -- get environment variable
os.setenv(name, value) -- set/unset environment variable
@ -7,14 +11,15 @@ os.environ() -- returns a copy of the environment
os.sleep(seconds) -- sleep for (floating) seconds
-- File system
os.chdir(pathname)
cwd = os.currentdir()
os.chdir(pathname)
os.mkdir(pathname)
os.remove(pathname)
for stat in os.dir(pathname) do ; end
stat = os.stat(pathname)
for entry in os.dir(pathname) do ; end
entry = os.dirent(pathname)
--[[
stat is a table, containing at least the following keys:
entry is a table, containing at least the following keys:
name: the filename
type: "file" or "directory" or another implementation-defined string
size: the file size in bytes

17
conf

@ -0,0 +1,17 @@
### Change these to match your Lua installation
LUA= /home/medgar/src/lang/lua/lua-5.1.1
LUAINC= -I$(LUA)/src
LUALIB= -L$(LUA)/src -llua51
#LUA= /home/mark/luabinaries/lua51
#LUAINC= -I$(LUA)/include
#LUALIB= -L$(LUA) -llua5.1
### Comment these if your system actually has posix_spawn()
POSIX_SPAWN= -DMISSING_POSIX_SPAWN
EXTRA= posix_spawn.o
### Change this if your system properly declares environ.
#ENVIRON= -DENVIRON_DECL=
ENVIRON= -DENVIRON_DECL="extern char **environ;"

@ -1,25 +1,18 @@
include ../conf
CFLAGS= $(WARNINGS) $(DEFINES) $(INCLUDES)
DEFINES = $(DEBUG) -D_XOPEN_SOURCE=600 -DMISSING_POSIX_SPAWN -DENVIRON_DECL="extern char **environ;"
DEBUG= -D'debug(...)=fprintf(stderr,__VA_ARGS__)'
# -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L \
-U__STRICT_ANSI__ -D_GNU_SOURCE
INCLUDES = -I$(LUA)/include -I$(LUA)/src
DEFINES= -D_XOPEN_SOURCE=600 $(POSIX_SPAWN) $(ENVIRON)
INCLUDES= $(LUAINC)
WARNINGS= -W -Wall
#LUA = /home/mark/src/lang/lua/lua-5.1-rc2
LUA = /home/medgar/src/lang/lua/lua-5.1.1
#LUA = /home/medgar/src/lang/lua/lua5_1_1/cygw15
LIBS = -L$(LUA)/src -llua5.1
ex-OBJS = ex.o spawn.o
LIBS= $(LUALIB)
default: ex.so
EXTRA = posix_spawn.o
ex.so: $(ex-OBJS) $(EXTRA); $(CC) -shared -o $@ $(ex-OBJS) $(EXTRA) $(LIBS)
T= ex.so
default: $(T)
OBJS= ex.o spawn.o $(EXTRA)
$(T): $(OBJS) $(EXTRA); $(CC) -shared -o $@ $(OBJS) $(LIBS)
ex.o: ex.c spawn.h
spawn.o: spawn.c spawn.h
posix_spawn.o: posix_spawn.c posix_spawn.h
clean:; rm -f *.o ex.dll ex.so ex.a
clean:; rm -f *.o ex.so ex.dll $(T)

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <stdlib.h>
#include <assert.h>
#include <errno.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <sched.h>
#include <signal.h>
#include <sys/types.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <unistd.h>
ENVIRON_DECL
#include <sys/wait.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#ifndef SPAWN_H
#define SPAWN_H

@ -1,17 +1,13 @@
include ../conf
TARGET_ARCH= -mno-cygwin
CFLAGS= $(WARNINGS) $(DEFINES) $(INCLUDES)
DEFINES = -DWIN32_LEAN_AND_MEAN
INCLUDES = -I${LUA}/include
DEFINES= -DWIN32_LEAN_AND_MEAN -DNOGDI
INCLUDES= $(LUAINC)
WARNINGS= -W -Wall -Wno-missing-braces
#LUA = /home/mark/src/lang/lua/lua-5.1-rc2
#LUA = /home/mark/src/lang/lua/lua51
LUA = /home/medgar/work/noom/lua/lua51
LUALIBS = -L$(LUA) -llua5.1
ex.dll-OBJS = ex.o spawn.o pusherror.o dirent.o
ex.dll-LIBS = $(LUALIBS) $(EXTRALIBS)
ex.dll: $(ex.dll-OBJS)
$(CC) $(TARGET_ARCH) -shared -o $@ $(ex.dll-OBJS) $(ex.dll-LIBS)
clean:; rm ex.dll *.o
OBJS= ex.o spawn.o pusherror.o dirent.o
LIBS= $(LUALIB)
ex.dll: $(OBJS); $(CC) $(TARGET_ARCH) -shared -o $@ $(OBJS) $(LIBS)
wdir.o: wdir.c wdir.h
clean:; rm -f ex.dll *.o

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <windows.h>
#include <stdlib.h>
#include "dirent.h"

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <windows.h>
typedef struct DIR_tag DIR;

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <stdio.h> /* sprintf() */
#include <ctype.h>
#define WIN32_LEAN_AND_MEAN 1

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#ifndef pusherror_h
#define pusherror_h

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#include <stdlib.h>
#include <windows.h>
#include <io.h>

@ -1,3 +1,8 @@
/*
* "ex" API implementation
* http://lua-users.org/wiki/ExtensionProposal
* Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >
*/
#ifndef SPAWN_H
#define SPAWN_H

Loading…
Cancel
Save