Skip to content

Instantly share code, notes, and snippets.

@Juanmcuello
Created November 7, 2013 15:02
Show Gist options
  • Save Juanmcuello/7356047 to your computer and use it in GitHub Desktop.
Save Juanmcuello/7356047 to your computer and use it in GitHub Desktop.
CPPFLAGS = -I/home/juan/projects/e-resto/pos-printerdriver/npapi-sdk-read-only/headers
CFLAGS = -Wall -g -D_XOPEN_SOURCE=600
ifdef DEBUG
CFLAGS += -DDEBUG
endif
ifndef WIN32
CFLAGS += -fPIC -DXP_UNIX=1
else
CXX=i686-w64-mingw32-g++
endif
CXXFLAGS = $(CFLAGS) -std=c++0x
ifndef WIN32
all: nperesto.so
else
all: nperesto.dll
endif
nperesto.so: eresto-plugin.o eresto-pos.o pos.o
$(CXX) $(CXXFLAGS) -shared -o $@ $^
nperesto.dll: eresto-plugin.o eresto-plugin.res eresto-pos.o pos.o
$(CXX) $(CXXFLAGS) -shared -static-libgcc -static-libstdc++ -mwindows -Wl,--kill-at -o $@ $^ -lwinspool
eresto-plugin.res: eresto-plugin.rc
-i686-w64-mingw32-windres -O coff $? $@
clean:
@rm -f *.o
@rm -f *.res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment