Add Copyright notice

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

@ -1,15 +1,10 @@
CFLAGS = $(WARNINGS) $(DEFINES) $(INCLUDES) default:; @echo Choose a platform: mingw cygwin linux
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
all: mingw cygwin all: mingw cygwin
mingw:; $(MAKE) -C w32api ex.dll mingw:; $(MAKE) -C w32api ex.dll
cygwin:; $(MAKE) -C posix ex.dll cygwin:; $(MAKE) -C posix T=ex.dll ex.dll
posix:; $(MAKE) -C posix ex.so 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 -- Environment
os.getenv(name) -- get environment variable os.getenv(name) -- get environment variable
os.setenv(name, value) -- set/unset 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 os.sleep(seconds) -- sleep for (floating) seconds
-- File system -- File system
os.chdir(pathname)
cwd = os.currentdir() cwd = os.currentdir()
os.chdir(pathname)
os.mkdir(pathname) os.mkdir(pathname)
os.remove(pathname)
for stat in os.dir(pathname) do ; end for entry in os.dir(pathname) do ; end
stat = os.stat(pathname) 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 name: the filename
type: "file" or "directory" or another implementation-defined string type: "file" or "directory" or another implementation-defined string
size: the file size in bytes 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) CFLAGS= $(WARNINGS) $(DEFINES) $(INCLUDES)
DEFINES = $(DEBUG) -D_XOPEN_SOURCE=600 -DMISSING_POSIX_SPAWN -DENVIRON_DECL="extern char **environ;" DEFINES= -D_XOPEN_SOURCE=600 $(POSIX_SPAWN) $(ENVIRON)
DEBUG= -D'debug(...)=fprintf(stderr,__VA_ARGS__)' INCLUDES= $(LUAINC)
# -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
WARNINGS= -W -Wall WARNINGS= -W -Wall
#LUA = /home/mark/src/lang/lua/lua-5.1-rc2 LIBS= $(LUALIB)
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
default: ex.so T= ex.so
default: $(T)
EXTRA = posix_spawn.o
ex.so: $(ex-OBJS) $(EXTRA); $(CC) -shared -o $@ $(ex-OBJS) $(EXTRA) $(LIBS)
OBJS= ex.o spawn.o $(EXTRA)
$(T): $(OBJS) $(EXTRA); $(CC) -shared -o $@ $(OBJS) $(LIBS)
ex.o: ex.c spawn.h ex.o: ex.c spawn.h
spawn.o: spawn.c spawn.h spawn.o: spawn.c spawn.h
posix_spawn.o: posix_spawn.c posix_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 <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.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 <stdlib.h>
#include <assert.h> #include <assert.h>
#include <errno.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 <sched.h>
#include <signal.h> #include <signal.h>
#include <sys/types.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> #include <unistd.h>
ENVIRON_DECL ENVIRON_DECL
#include <sys/wait.h> #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 #ifndef SPAWN_H
#define SPAWN_H #define SPAWN_H

@ -1,17 +1,13 @@
include ../conf
TARGET_ARCH= -mno-cygwin TARGET_ARCH= -mno-cygwin
CFLAGS= $(WARNINGS) $(DEFINES) $(INCLUDES) CFLAGS= $(WARNINGS) $(DEFINES) $(INCLUDES)
DEFINES = -DWIN32_LEAN_AND_MEAN DEFINES= -DWIN32_LEAN_AND_MEAN -DNOGDI
INCLUDES = -I${LUA}/include INCLUDES= $(LUAINC)
WARNINGS= -W -Wall -Wno-missing-braces 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 OBJS= ex.o spawn.o pusherror.o dirent.o
ex.dll-LIBS = $(LUALIBS) $(EXTRALIBS) LIBS= $(LUALIB)
ex.dll: $(ex.dll-OBJS) ex.dll: $(OBJS); $(CC) $(TARGET_ARCH) -shared -o $@ $(OBJS) $(LIBS)
$(CC) $(TARGET_ARCH) -shared -o $@ $(ex.dll-OBJS) $(ex.dll-LIBS)
clean:; rm ex.dll *.o
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 <windows.h>
#include <stdlib.h> #include <stdlib.h>
#include "dirent.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> #include <windows.h>
typedef struct DIR_tag DIR; 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 <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.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 <stdio.h> /* sprintf() */
#include <ctype.h> #include <ctype.h>
#define WIN32_LEAN_AND_MEAN 1 #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 #ifndef pusherror_h
#define 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 <stdlib.h>
#include <windows.h> #include <windows.h>
#include <io.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 #ifndef SPAWN_H
#define SPAWN_H #define SPAWN_H

Loading…
Cancel
Save