freeswitch/libs/libscgi/Makefile

52 lines
1.2 KiB
Makefile
Raw Normal View History

2012-05-09 15:05:03 -04:00
PWD=$(shell pwd)
INCS=-I$(PWD)/src/include
DEBUG=-g -ggdb
BASE_FLAGS=$(INCS) $(DEBUG) -fPIC
PICKY=-O2
CFLAGS=$(BASE_FLAGS) $(PICKY)
CXXFLAGS=$(BASE_FLAGS)
MYLIB=libscgi.a
LIBS=
LDFLAGS=-L.
2012-05-23 10:37:54 -04:00
OBJS=src/scgi.o
SRC=src/scgi.c src/scgi_oop.cpp
HEADERS=src/include/scgi.h src/include/scgi_oop.h
2012-05-09 15:05:03 -04:00
SOLINK=-shared -Xlinker -x
2012-05-23 10:37:54 -04:00
# comment the next line to disable c++ (no swig mods for you then)
OBJS += src/scgi_oop.o
2012-05-09 15:05:03 -04:00
2012-05-10 09:23:23 -04:00
all: $(MYLIB) testclient testserver
2012-05-09 15:05:03 -04:00
$(MYLIB): $(OBJS) $(HEADERS) $(SRC)
ar rcs $(MYLIB) $(OBJS)
ranlib $(MYLIB)
%.o: %.c $(HEADERS)
$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
2012-05-23 10:37:54 -04:00
%.o: %.cpp $(HEADERS)
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@
2012-05-09 15:05:03 -04:00
testclient: $(MYLIB) testclient.c
$(CC) $(CC_CFLAGS) $(CFLAGS) testclient.c -o testclient -lscgi $(LDFLAGS) $(LIBS)
2012-05-10 09:23:23 -04:00
testserver: $(MYLIB) testserver.c
$(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver -lscgi $(LDFLAGS) $(LIBS)
2012-05-09 15:05:03 -04:00
clean:
2012-05-10 09:23:23 -04:00
rm -f *.o src/*.o libscgi.a *~ src/*~ src/include/*~ testclient testserver
2012-05-23 10:37:54 -04:00
$(MAKE) -C perl clean
reswig: swigclean
$(MAKE) -C perl reswig
swigclean: clean
$(MAKE) -C perl swigclean
perlmod: $(MYLIB)
$(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
perlmod-install: perlmod
$(MAKE) -C perl install