diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2000-12-29 22:15:09 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2000-12-29 22:15:09 +0000 |
commit | 17c4d1c30544f0ed638879835f179ada96249868 (patch) | |
tree | 46ca8042ba8fda147f56af61e26ec2ceec41f614 /makefile.dist | |
parent | 6f9d15b66027cef58441549f8ac0603ca42da0ac (diff) | |
download | luasocket-17c4d1c30544f0ed638879835f179ada96249868.tar.gz luasocket-17c4d1c30544f0ed638879835f179ada96249868.tar.bz2 luasocket-17c4d1c30544f0ed638879835f179ada96249868.zip |
Initial revision
Diffstat (limited to 'makefile.dist')
-rw-r--r-- | makefile.dist | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/makefile.dist b/makefile.dist new file mode 100644 index 0000000..19a3775 --- /dev/null +++ b/makefile.dist | |||
@@ -0,0 +1,81 @@ | |||
1 | #-------------------------------------------------------------------------- | ||
2 | # LuaSocket makefile | ||
3 | # Test executable for socklib | ||
4 | # Diego Nehab, 29/8/1999 | ||
5 | #-------------------------------------------------------------------------- | ||
6 | |||
7 | # don't echo commands | ||
8 | # .SILENT: | ||
9 | |||
10 | CXX = g++ | ||
11 | CC = gcc | ||
12 | |||
13 | DIST = luasocket-1.1 | ||
14 | |||
15 | WARNINGS = -Wall -Wshadow -Wpointer-arith -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs | ||
16 | |||
17 | CFLAGS = $(WARNINGS) -D_DEBUG -O2 | ||
18 | |||
19 | LUA = /home/diego/lib/lua | ||
20 | LUALIB = $(LUA)/lib | ||
21 | LUAINC = $(LUA)/include | ||
22 | |||
23 | INC = -I$(LUAINC) | ||
24 | # LIB = $(LUA_LIB)/liblualib.a $(LUA_LIB)/liblua.a -lm -lsocket -lnsl | ||
25 | # LIB = $(LUA_LIB)/liblualib.a $(LUA_LIB)/liblua.a -lm -lnsl | ||
26 | LIB = $(LUALIB)/liblualib.a $(LUALIB)/liblua.a -lm | ||
27 | |||
28 | SRC = ~diego/tec/luasocket | ||
29 | OBJ = /tmp | ||
30 | DEP = /tmp | ||
31 | |||
32 | # list of .cpp files | ||
33 | c_sources = luasocket.c lua.c | ||
34 | |||
35 | # corresponding .o files | ||
36 | c_objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(c_sources)))) | ||
37 | |||
38 | # binary depends on objects | ||
39 | luasocket: $(c_objects) | ||
40 | $(CC) $(CPPFLAGS) -o $@ $(c_objects) $(LIB) | ||
41 | |||
42 | # rule to create them | ||
43 | $(c_objects): $(OBJ)/%.o: $(SRC)/%.c | ||
44 | $(CC) -c $(CFLAGS) $(INC) -o $@ $< | ||
45 | |||
46 | # corresponding .d files | ||
47 | c_deps = $(addprefix $(DEP)/, $(addsuffix .d, $(basename $(c_sources)))) | ||
48 | |||
49 | # makefile depend on them... | ||
50 | makefile : $(c_deps) | ||
51 | |||
52 | # ... since it includes them | ||
53 | -include $(c_deps) | ||
54 | |||
55 | # rule to create them | ||
56 | $(c_deps) : $(DEP)/%.d : $(SRC)/%.c | ||
57 | $(SHELL) -ec '$(CC) -MM $(CFLAGS) $(INC) $< \ | ||
58 | | sed '\''s%\($*\.o\)%$@ $(OBJ)/\1%'\'' > $@; \ | ||
59 | [ -s $@ ] || rm -f $@' | ||
60 | |||
61 | # clean all trash | ||
62 | clean: | ||
63 | rm -f $(OBJ)/*.o | ||
64 | rm -f $(DEP)/*.d | ||
65 | rm -f luasocket core | ||
66 | |||
67 | dist: | ||
68 | mkdir -p $(DIST)/lua | ||
69 | mkdir -p $(DIST)/examples | ||
70 | mkdir -p $(DIST)/html | ||
71 | cp -vf *.c $(DIST) | ||
72 | cp -vf *.h $(DIST) | ||
73 | cp -vf makefile $(DIST) | ||
74 | cp -vf README $(DIST) | ||
75 | cp -vf lua/*.lua $(DIST)/lua | ||
76 | cp -vf lua/README $(DIST)/lua | ||
77 | cp -vf examples/*.lua $(DIST)/examples | ||
78 | cp -vf examples/README $(DIST)/examples | ||
79 | cp -vf html/manual.html $(DIST)/html | ||
80 | tar -zcvf $(DIST).tar.gz $(DIST) | ||
81 | zip -r $(DIST).zip $(DIST) | ||