~caglow/ci/trunk

« back to all changes in this revision

Viewing changes to src/Makefile

  • Committer: Caglow
  • Date: 2010-06-07 20:24:05 UTC
  • Revision ID: svn-v4:31e3fcef-1472-0410-85f0-a590c57410d1:trunk:19
Naming changes. Completed system for libraries. Updated readme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
PLAT= none
8
8
 
9
9
CC = gcc
10
 
CFLAGS = -O3 -Wmain -pedantic $(MYCFLAGS)
 
10
CFLAGS = -O3 -Wall $(MYCFLAGS)
11
11
AR = ar rcu
12
12
RANLIB = ranlib
13
13
RM = rm -f
17
17
 
18
18
MYCFLAGS =
19
19
MYLDFLAGS =
20
 
MYLIBS =
 
20
MYLIBS = 
21
21
 
22
22
BINDIR = ../bin/
23
23
OBJDIR = ../bin/o/
24
24
 
25
25
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
26
26
 
27
 
PLATS = aix ansi bsd freebsd generic linux macosx mingw posix solaris
 
27
PLATS = aix ansi bsd freebsd generic linux macosx posix solaris windows
28
28
 
29
 
CI_A =  libci.a
 
29
CI_A =  libi.a
30
30
CORE_O = iapi.o code.o debug.o do.o dump.o func.o gc.o lex.o mem.o \
31
31
        obj.o opc.o parse.o state.o str.o table.o tm.o  \
32
32
        undmp.o vm.o zio.o
33
33
LIB_O = aulib.o mainlib.o calclib.o deblib.o iolib.o oslib.o tablib.o \
34
34
        strlib.o loadlib.o init.o
35
35
 
36
 
CI_T =  ci
37
 
CI_O =  ii.o
 
36
CI_T =  i
 
37
CI_O =  enter.o write.o
 
38
 
 
39
CL = i.exe libi.dll
38
40
 
39
41
ALL_O = $(CORE_O) $(LIB_O) $(CI_O)
40
42
ALL_T = $(CI_A) $(CI_T)
60
62
        $(CP) $(CORE_O) $(CPTARGET)$(OBJDIR)
61
63
 
62
64
clean:
63
 
        $(RM) $(ALL_T) $(ALL_O)
 
65
        $(RM) $(ALL_T) $(ALL_O) $(CL)
64
66
 
65
67
depend:
66
68
        @$(CC) $(CFLAGS) -MM *.c write.c
98
100
        $(MAKE) all MYCFLAGS=
99
101
 
100
102
linux:
101
 
        $(MAKE) all MYCFLAGS=-DCI_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
 
103
        $(MAKE) all MYCFLAGS="-DCI_USE_LINUX -fPIC" MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
102
104
 
103
105
macosx:
104
106
        $(MAKE) all MYCFLAGS=-DCI_USE_LINUX MYLIBS="-lreadline"
105
107
# use this on Mac OS X 10.3-
106
108
#       $(MAKE) all MYCFLAGS=-DCI_USE_MACOSX
107
109
 
108
 
mingw:
109
 
        $(MAKE) "CI_A=libci.dll" "CI_T=ci.exe" \
110
 
        "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
111
 
        "MYCFLAGS=-DCI_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" ci.exe
112
 
 
113
110
posix:
114
 
        $(MAKE) all MYCFLAGS=-DCI_USE_POSIX
 
111
        $(MAKE) all MYCFLAGS="-DCI_USE_POSIX -fPIC"
115
112
 
116
113
solaris:
117
114
        $(MAKE) all MYCFLAGS="-DCI_USE_POSIX -DCI_USE_DLOPEN" MYLIBS="-ldl"
118
115
 
 
116
windows:
 
117
        $(MAKE) "CI_A=libi.dll" "CI_T=i.exe" \
 
118
        "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
 
119
        "MYCFLAGS=-D_WINDOWS" "MYLIBS=" "MYLDFLAGS=-Wl,--out-implib=libi.a -s" i.exe
 
120
 
119
121
# list targets that do not create files (but not all makes understand .PHONY)
120
122
.PHONY: all $(PLATS) default o a clean depend echo none
121
123
 
167
169
tablib.o: tablib.c cic.h icfg.h aulib.h ilib.h
168
170
tm.o: tm.c cic.h icfg.h obj.h ilim.h state.h tm.h zio.h \
169
171
  mem.h str.h gc.h table.h
170
 
ii.o: ii.c cic.h icfg.h aulib.h ilib.h
 
172
enter.o: enter.c cic.h icfg.h aulib.h ilib.h
171
173
undmp.o: undmp.c cic.h icfg.h debug.h state.h obj.h \
172
174
  ilim.h tm.h zio.h mem.h do.h func.h str.h gc.h undmp.h
173
175
vm.o: vm.c cic.h icfg.h debug.h state.h obj.h ilim.h tm.h \