srcdir = . top_srcdir = .. top_builddir = .. CC = gcc AS = gcc -c OBJS = test_main.o x86_64_test.o CFLAGS += -O2 -g -I$(srcdir)/../include PIC_CFLAGS = -fPIC LIBS = -L$(top_builddir)/src -lfunchook -Wl,-rpath,$(top_builddir)/src -L. -lfunchook_test -Wl,-rpath,. LINK_SHARED = $(CC) -shared EXEEXT = DLLTOOL = $(firstword $(CC:gcc=dlltool)) SO_OBJS = $(srcdir)/libfunchook_test.c $(srcdir)/libfunchook_test2.c #LDFLAGS += -Wl,--out-implib,funchook_test.lib #FUNCHOOK_TEST_LIB = funchook_test_exe.lib #LDFLAGS += -Wl,-undefined,dynamic_lookup VPATH = ../src all: funchook_test$(EXEEXT) test: funchook_test$(EXEEXT) # cmp -s $(top_builddir)/src/funchook.dll funchook.dll || cp $(top_builddir)/src/funchook.dll funchook.dll ./funchook_test$(EXEEXT) funchook_test$(EXEEXT): $(OBJS) libfunchook.so libfunchook_test.so $(CC) -o funchook_test$(EXEEXT) $(OBJS) $(LIBS) libfunchook_test.so: $(SO_OBJS) $(FUNCHOOK_TEST_LIB) $(LINK_SHARED) $(LDFLAGS) $(PIC_CFLAGS) $(CFLAGS) -o libfunchook_test.so $(SO_OBJS) $(FUNCHOOK_TEST_LIB) clean: $(RM) $(TESTEXE) *.o libfunchook_test.so Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && ./config.status funchook_test_exe.lib: echo "LIBRARY funchook_test.exe" > funchook_test_exe.def echo "EXPORTS" >> funchook_test_exe.def echo "get_val_in_exe" >> funchook_test_exe.def $(DLLTOOL) -d funchook_test_exe.def -l funchook_test_exe.lib