Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ lib/

# Folders created at documentation generation
doc/build/

# Makefile
*.d
*.o
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
SQPROF_CXXFLAGS = -pg -pie -g3
SQ64_CXXFLAGS = -m64 -D_SQ64

SQUIRREL=.
MAKE=make
all: sq32

sq32: folders
cd squirrel; $(MAKE)
cd sqstdlib; $(MAKE)
cd sq; $(MAKE)
$(MAKE) -C squirrel
$(MAKE) -C sqstdlib
$(MAKE) -C sq

sqprof: folders
cd squirrel; $(MAKE) sqprof
cd sqstdlib; $(MAKE) sqprof
cd sq; $(MAKE) sqprof
CXXFLAGS="$(SQPROF_CXXFLAGS)" $(MAKE) -C squirrel
CXXFLAGS="$(SQPROF_CXXFLAGS)" $(MAKE) -C sqstdlib
CXXFLAGS="$(SQPROF_CXXFLAGS)" $(MAKE) -C sq

sq64: folders
cd squirrel; $(MAKE) sq64
cd sqstdlib; $(MAKE) sq64
cd sq; $(MAKE) sq64
CXXFLAGS="$(SQ64_CXXFLAGS)" $(MAKE) -C squirrel
CXXFLAGS="$(SQ64_CXXFLAGS)" $(MAKE) -C sqstdlib
CXXFLAGS="$(SQ64_CXXFLAGS)" $(MAKE) -C sq

folders:
mkdir -p lib
mkdir -p bin
mkdir -p lib bin

clean:
$(MAKE) -C squirrel clean
$(MAKE) -C sqstdlib clean
$(MAKE) -C sq clean
4 changes: 2 additions & 2 deletions sq/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_C_STANDARD 99)
if(NOT DISABLE_DYNAMIC)
add_executable(sq sq.c)
add_executable(sq sq.cpp)
add_executable(squirrel::interpreter ALIAS sq)
set_target_properties(sq PROPERTIES EXPORT_NAME interpreter)
target_link_libraries(sq squirrel sqstdlib)
Expand All @@ -14,7 +14,7 @@ if(NOT DISABLE_DYNAMIC)
endif()

if(NOT DISABLE_STATIC)
add_executable(sq_static sq.c)
add_executable(sq_static sq.cpp)
add_executable(squirrel::interpreter_static ALIAS sq_static)
set_target_properties(sq_static PROPERTIES EXPORT_NAME interpreter_static)
target_link_libraries(sq_static squirrel_static sqstdlib_static)
Expand Down
29 changes: 13 additions & 16 deletions sq/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
SQUIRREL= ..
TARGET = ../bin/sq

SRCS = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp,%.o,$(SRCS))
DEPS = $(patsubst %.cpp,%.d,$(SRCS))

OUT= $(SQUIRREL)/bin/sq
INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs
LIBZ= -L$(SQUIRREL)/lib
LIB= -lsquirrel -lsqstdlib
DEPFLAGS = -MMD -MP -MF $*.d
CXXFLAGS += -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -I../include $(DEPFLAGS)
LDFLAGS += -L../lib -lsquirrel -lsqstdlib

OBJS= sq.o
all: $(TARGET)

SRCS= sq.c
$(TARGET): $(OBJS) ../lib/libsquirrel.a ../lib/libsqstdlib.a
$(CXX) $(OBJS) -o $@ $(LDFLAGS)


sq32:
g++ -O2 -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)

sqprof:
g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)

sq64:
g++ -O2 -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
.PHONY: clean
clean:
rm -f $(TARGET) *.o *.d
File renamed without changes.
2 changes: 1 addition & 1 deletion sq/sq.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 13 additions & 38 deletions sqstdlib/Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,19 @@
SQUIRREL= ..
TARGET = ../lib/libsqstdlib.a

SRCS = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp,%.o,$(SRCS))
DEPS = $(patsubst %.cpp,%.d,$(SRCS))

CC?= gcc
OUT?= $(SQUIRREL)/lib/libsqstdlib.a
INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= $(CC_EXTRA_FLAGS)
LIB=
DEPFLAGS = -MMD -MP -MF $*.d
CXXFLAGS += -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -I../include $(DEPFLAGS)

OBJS= \
sqstdblob.o \
sqstdio.o \
sqstdstream.o \
sqstdmath.o \
sqstdsystem.o \
sqstdstring.o \
sqstdaux.o \
sqstdrex.o
all: $(TARGET)

SRCS= \
sqstdblob.cpp \
sqstdio.cpp \
sqstdstream.cpp \
sqstdmath.cpp \
sqstdsystem.cpp \
sqstdstring.cpp \
sqstdaux.cpp \
sqstdrex.cpp
$(TARGET): $(OBJS)
ar rc $@ $(OBJS)

-include $(DEPS)

sq32:
$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o

sqprof:
$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o

sq64:
$(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o
.PHONY: clean
clean:
rm -f $(TARGET) *.o *.d
60 changes: 13 additions & 47 deletions squirrel/Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,19 @@
SQUIRREL= ..
TARGET = ../lib/libsquirrel.a

SRCS = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp,%.o,$(SRCS))
DEPS = $(patsubst %.cpp,%.d,$(SRCS))

CC?= gcc
OUT?= $(SQUIRREL)/lib/libsquirrel.a
INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= $(CC_EXTRA_FLAGS)
LIB=
DEPFLAGS = -MMD -MP -MF $*.d
CXXFLAGS += -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -I../include $(DEPFLAGS)

OBJS= \
sqapi.o \
sqbaselib.o \
sqfuncstate.o \
sqdebug.o \
sqlexer.o \
sqobject.o \
sqcompiler.o \
sqstate.o \
sqtable.o \
sqmem.o \
sqvm.o \
sqclass.o
all: $(TARGET)

SRCS= \
sqapi.cpp \
sqbaselib.cpp \
sqfuncstate.cpp \
sqdebug.cpp \
sqlexer.cpp \
sqobject.cpp \
sqcompiler.cpp \
sqstate.cpp \
sqtable.cpp \
sqmem.cpp \
sqvm.cpp \
sqclass.cpp
$(TARGET): $(OBJS)
ar rc $@ $(OBJS)

-include $(DEPS)


sq32:
$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o

sqprof:
$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o

sq64:
$(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
ar rc $(OUT) *.o
rm *.o
.PHONY: clean
clean:
rm -f $(TARGET) *.o *.d