aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/libsamp/examples/Makefile
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/voclient/libsamp/examples/Makefile
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vendor/voclient/libsamp/examples/Makefile')
-rw-r--r--vendor/voclient/libsamp/examples/Makefile165
1 files changed, 165 insertions, 0 deletions
diff --git a/vendor/voclient/libsamp/examples/Makefile b/vendor/voclient/libsamp/examples/Makefile
new file mode 100644
index 00000000..9096b935
--- /dev/null
+++ b/vendor/voclient/libsamp/examples/Makefile
@@ -0,0 +1,165 @@
+#///////////////////////////////////////////////////////////////////////////////
+#//
+#// Makefile for the libsamp example tasks.
+#//
+#///////////////////////////////////////////////////////////////////////////////
+
+# primary dependencies
+
+NAME = samp
+VERSION = 1.0
+PLATFORM := $(shell uname -s)
+PLMACH := $(shell ../../getarch)
+HERE := $(shell /bin/pwd)
+
+
+# secondary dependencies
+
+LIBBASE = lib$(NAME)
+STATICLIB = $(HERE)/$(LIBBASE).a
+SHAREDLIB = $(HERE)/$(LIBBASE).so.$(VERSION)
+
+
+# stuff that's precious to keep
+
+.PRECIOUS: $(STATICLIB) $(SHAREDLIB)
+.KEEP_STATE:
+
+
+# includes, flags and libraries
+CC = gcc
+CINCS = -I$(HERE) -I../ -I../../include -L../ -L../../lib/ -L../
+CFLAGS = -g -Wall -D$(PLATFORM) $(CINCS)
+
+ifeq ("$(PLATFORM)", "Darwin")
+ ifeq ("$(PLMACH)", "macintel")
+ CARCH = -m64 -mmacosx-version-min=10.5
+ else
+ CARCH = -arch i386 -arch ppc -m32 -mmacosx-version-min=10.4
+ endif
+else
+ CLIBS = -lm -lc -lpthread -lcurl
+ CARCH = -D$(PLATFORM)
+endif
+
+#CARCH = -arch i386 -arch ppc -m32 -mmacosx-version-min=10.4
+CLIBS = -lm -lc -lcurl -lpthread
+CFLAGS = -g -Wall $(CARCH) -D$(PLATFORM) $(CINCS) -L./
+
+
+
+
+#F77 = g77
+F77 = gfortran
+FFLAGS = -g -Wall
+
+
+
+# list of source and include files
+
+C_SRCS = snoop.c send.c
+C_OBJS =
+C_INCS =
+
+F77_SRCS =
+F77_OBJS =
+F77_INCS =
+
+SPP_SRCS =
+SPP_OBJS =
+SPP_INCS =
+
+
+LIBS = -lsamp -lcurl
+
+SPP_TASKS =
+F77_TASKS =
+C_TASKS = snoop send
+
+TARGETS = $(F77_TASKS) $(SPP_TASKS) $(C_TASKS)
+
+
+# Targets
+
+all: $(TARGETS)
+
+c_progs: $(C_TASKS)
+spp_progs: $(SPP_TASKS)
+f77_progs: $(F77_TASKS)
+
+clean:
+ /bin/rm -rf .make.state .nse_depinfo *.[aeo] *.dSYM
+ /bin/rm -rf $(TARGETS)
+
+everything:
+ make clean
+ make all
+ make install
+
+help: HELP
+
+install: all
+
+
+
+###############################################################################
+# Unit test programs to be built.
+###############################################################################
+
+demo: $(TARGETS)
+
+
+###########################
+# C Test programs
+###########################
+
+zztest: zztest.c
+ $(CC) $(CFLAGS) -o zztest zztest.c $(LIBS)
+
+snoop: snoop.c ../libsamp.a
+ $(CC) $(CFLAGS) -o snoop snoop.c $(LIBS)
+
+send: send.c ../libsamp.a
+ $(CC) $(CFLAGS) -o send send.c $(LIBS)
+
+
+
+###########################
+# SPP Test programs
+###########################
+
+#foo_spp: foo_spp.x
+# xc -/I../ -/L../ foo_spp.x -lsamp
+
+
+
+###########################
+# Fortran Test programs.
+###########################
+
+#foo_f77: foo_f77.f
+# $(F77) $(FFLAGS) -o foo_f77 foo_f77.f ../libsamp.a -lc
+
+
+
+
+###############################################################################
+# Leave this stuff alone.
+###############################################################################
+
+$(STATICLIB): $(C_SRCS:%.c=Static/%.o)
+ /usr/bin/ar rv $@ $?
+Static/%.o: %.c $(C_INCS)
+ /usr/bin/gcc $(CINCS) $(CFLAGS) -c $< -o $@
+Static:
+ /bin/mkdir $@
+ chmod 777 $@
+
+$(SHAREDLIB): $(C_SRCS:%.c=Shared/%.o)
+ /usr/bin/ld -shared -o $@ $? -lc -ldl
+Shared/%.o: %.c $(C_INCS)
+ /usr/bin/gcc $(CINCS) $(CFLAGS) -fpic -shared -c $< -o $@
+Shared:
+ /bin/mkdir $@
+ chmod 777 $@
+