src/Makefile
changeset 46 7471e31bb278
parent 38 271bea5552dc
child 66 805bfae3cdc4
     1.1 --- a/src/Makefile	Fri Jan 16 18:39:27 2015 +0100
     1.2 +++ b/src/Makefile	Sat Jan 24 15:26:40 2015 +0100
     1.3 @@ -7,24 +7,12 @@
     1.4  MACOSX_VERSION_MIN=10.6
     1.5  GPGME_IN=$(HOME)
     1.6  LIBGPGME=libgpgme-pthread.dylib
     1.7 -CC=gcc -std=c99
     1.8 +CC=clang -std=c99 -pthread
     1.9 +LD=clang
    1.10  CFLAGS=-I$(GPGME_IN)/include -I/opt/local/include $(OPTIMIZE) -pedantic \
    1.11 -	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\"  -DSQLITE_THREADSAFE=1
    1.12 -LDFLAGS=-lc -macosx_version_min $(MACOSX_VERSION_MIN) -dylib -arch x86_64 \
    1.13 -	-L/opt/local/lib -letpan
    1.14 -
    1.15 -else ifeq ($(BUILD_FOR),Windoze)
    1.16 -
    1.17 -TARGET=pEpEngine.dll
    1.18 -GPGME_IN=$(HOME)
    1.19 -LIBGPGME=libgpgme-11.dll
    1.20 -CC=i686-w64-mingw32-gcc -std=c99
    1.21 -CXX=i686-w64-mingw32-g++
    1.22 -LD=i686-w64-mingw32-gcc
    1.23 -CFLAGS=-I$(HOME)/i686-w64-mingw32/include -I$(GPGME_IN)/include $(OPTIMIZE) -pedantic \
    1.24 -	-DLIBGPGME=\"$(LIBGPGME)\" -DWIN32 -DSQLITE_THREADSAFE=1
    1.25 -LDFLAGS=-shared -L$(HOME)/i686-w64-mingw32/lib -llibstdc++ \
    1.26 -	-Wl,--output-def,pEpEngine.def,--out-implib,libpEpEngine.a
    1.27 +	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\"
    1.28 +LDFLAGS=-lc -shared -arch x86_64 \
    1.29 +	-L/opt/local/lib -letpan -lgpgme-pthread -lsqlite3
    1.30  
    1.31  else
    1.32  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.33 @@ -39,56 +27,19 @@
    1.34  CC=gcc -std=c99
    1.35  CFLAGS=-I$(GPGME_IN)/include $(OPTIMIZE) -fPIC -pedantic \
    1.36  	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\" -DSQLITE_THREADSAFE=1
    1.37 -LDFLAGS=-L$(GPGME_IN) -shared -lc -ldl
    1.38 -
    1.39 -else ifeq ($(BUILD_FOR),Windoze)
    1.40 -
    1.41 -TARGET=pEpEngine.dll
    1.42 -GPGME_IN=$(HOME)
    1.43 -LIBGPGME=libgpgme-11.dll
    1.44 -CC=i686-w64-mingw32-gcc -std=c99
    1.45 -CXX=i686-w64-mingw32-g++
    1.46 -LD=i686-w64-mingw32-gcc
    1.47 -CFLAGS=-I/usr/i686-w64-mingw32/include -I$(GPGME_IN)/include $(OPTIMIZE) -pedantic \
    1.48 -	-DLIBGPGME=\"$(LIBGPGME)\" -DWIN32 -DSQLITE_THREADSAFE=1
    1.49 -LDFLAGS=-shared -L/usr/i686-w64-mingw32/lib -llibstdc++ \
    1.50 -	-Wl,--output-def,pEpEngine.def,--out-implib,libpEpEngine.a
    1.51 +LDFLAGS=-L$(GPGME_IN) -shared -lc -ldl -letpan -lgpgme-pthread -lsqlite3
    1.52  
    1.53  else
    1.54  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.55  endif
    1.56  
    1.57 -else ifeq ($(BUILD_ON),MINGW32_NT-6.1)
    1.58 -
    1.59 -TARGET=pEpEngine.dll
    1.60 -GPGME_IN=/c/Program\ Files/GNU/GnuPG
    1.61 -LIBGPGME=libgpgme-11.dll
    1.62 -CC=gcc -std=gnu99
    1.63 -CFLAGS=-I$(GPGME_IN)/include $(OPTIMIZE) -pedantic -DWIN32 -DSQLITE_THREADSAFE=1
    1.64 -LD=gcc
    1.65 -LDFLAGS=-shared -llibstdc++ -Wl,--output-def,pEpEngine.def,--out-implib,libpEpEngine.a
    1.66 -
    1.67  else
    1.68  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.69  endif
    1.70  
    1.71 -ifeq ($(BUILD_FOR),Windoze)
    1.72 -ALL_SOURCE=$(filter-out platform_unix.c,$(wildcard *.c))
    1.73 -else ifeq ($(BUILD_FOR),MINGW32_NT-6.1)
    1.74 -ALL_SOURCE=$(filter-out platform_unix.c,$(wildcard *.c))
    1.75 -else
    1.76  ALL_SOURCE=$(wildcard *.c)
    1.77 -endif
    1.78 -
    1.79  DEPENDS=$(subst .c,.d,$(ALL_SOURCE))
    1.80 -
    1.81 -ifeq ($(BUILD_FOR),Windoze)
    1.82 -ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE)) platform_windows.o
    1.83 -else ifeq ($(BUILD_FOR),MINGW32_NT-6.1)
    1.84 -ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE)) platform_windows.o
    1.85 -else
    1.86  ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
    1.87 -endif
    1.88  
    1.89  all: $(TARGET)
    1.90  
    1.91 @@ -100,8 +51,8 @@
    1.92  
    1.93  -include $(DEPENDS)
    1.94  
    1.95 -platform_windows.o: platform_windows.cpp
    1.96 -	$(CXX) $(CXX_FLAGS) -o $@ -c $<
    1.97 +#platform_windows.o: platform_windows.cpp
    1.98 +#	$(CXX) $(CXX_FLAGS) -o $@ -c $<
    1.99  
   1.100  $(TARGET): libpEpEngine.a
   1.101  	$(LD) $(ALL_OBJECTS) $(LDFLAGS) -o $@