ext: first commit for surf lib
This commit is contained in:
parent
0bd553a078
commit
1bd6d20102
52
Makefile
52
Makefile
|
@ -6,30 +6,49 @@ include config.mk
|
||||||
|
|
||||||
SRC = surf.c
|
SRC = surf.c
|
||||||
OBJ = $(SRC:.c=.o)
|
OBJ = $(SRC:.c=.o)
|
||||||
|
LIBSRC = libsurf-webext.c
|
||||||
|
LIBOBJ = $(LIBSRC:.c=.lo)
|
||||||
|
|
||||||
all: options surf
|
all: options libsurf-webext.la surf
|
||||||
|
|
||||||
options:
|
options:
|
||||||
@echo surf build options:
|
@echo surf build options:
|
||||||
@echo "CFLAGS = $(SURF_CFLAGS)"
|
@echo "CFLAGS = $(SURFCFLAGS)"
|
||||||
@echo "LDFLAGS = $(SURF_LDFLAGS)"
|
@echo "LDFLAGS = $(SURFLDFLAGS)"
|
||||||
@echo "CC = $(CC)"
|
@echo "CC = $(CC)"
|
||||||
|
@echo "LIBCFLAGS = $(LIBCFLAGS)"
|
||||||
|
@echo "LIBLDFLAGS = $(LIBLDFLAGS)"
|
||||||
|
@echo "LIBTOOL = $(LIBTOOL)"
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
@echo CC -c $<
|
@echo CC -c $<
|
||||||
@$(CC) $(SURF_CFLAGS) -c $<
|
@$(CC) $(SURFCFLAGS) -c $<
|
||||||
|
|
||||||
|
.c.lo:
|
||||||
|
@echo libtool compile $<
|
||||||
|
@$(LIBTOOL) --mode compile --tag CC $(CC) $(LIBCFLAGS) -c $<
|
||||||
|
|
||||||
$(OBJ): config.h config.mk
|
$(OBJ): config.h config.mk
|
||||||
|
$(LIBOBJ): config.mk
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
@echo creating $@ from config.def.h
|
@echo creating $@ from config.def.h
|
||||||
@cp config.def.h $@
|
@cp config.def.h $@
|
||||||
|
|
||||||
|
libsurf-webext.la: $(LIBOBJ)
|
||||||
|
@echo libtool link $@
|
||||||
|
@$(LIBTOOL) --mode link --tag CC $(CC) $(LIBLDFLAGS) -o $@ \
|
||||||
|
$(LIBOBJ) -rpath $(DESTDIR)$(LIBPREFIX)
|
||||||
|
|
||||||
surf: $(OBJ)
|
surf: $(OBJ)
|
||||||
@echo CC -o $@
|
@echo CC -o $@
|
||||||
@$(CC) $(SURF_CFLAGS) -o $@ $(OBJ) $(SURF_LDFLAGS)
|
@$(CC) $(SURFCFLAGS) -o $@ $(OBJ) $(SURFLDFLAGS)
|
||||||
|
|
||||||
clean:
|
clean-lib:
|
||||||
|
@echo cleaning library
|
||||||
|
@rm -rf libsurf-webext.la .libs $(LIBOBJ) $(LIBOBJ:.lo=.o)
|
||||||
|
|
||||||
|
clean: clean-lib
|
||||||
@echo cleaning
|
@echo cleaning
|
||||||
@rm -f surf $(OBJ)
|
@rm -f surf $(OBJ)
|
||||||
|
|
||||||
|
@ -42,12 +61,18 @@ dist: distclean
|
||||||
@mkdir -p surf-$(VERSION)
|
@mkdir -p surf-$(VERSION)
|
||||||
@cp -R LICENSE Makefile config.mk config.def.h README \
|
@cp -R LICENSE Makefile config.mk config.def.h README \
|
||||||
surf-open.sh arg.h TODO.md surf.png \
|
surf-open.sh arg.h TODO.md surf.png \
|
||||||
surf.1 $(SRC) surf-$(VERSION)
|
surf.1 $(SRC) $(LIBSRC) surf-$(VERSION)
|
||||||
@tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
@tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
||||||
@gzip surf-$(VERSION).tar
|
@gzip surf-$(VERSION).tar
|
||||||
@rm -rf surf-$(VERSION)
|
@rm -rf surf-$(VERSION)
|
||||||
|
|
||||||
install: all
|
install-lib: libsurf-webext.la
|
||||||
|
@echo installing library file to $(DESTDIR)$(LIBPREFIX)
|
||||||
|
@mkdir -p $(DESTDIR)$(LIBPREFIX)
|
||||||
|
@$(LIBTOOL) --mode install install -c libsurf-webext.la \
|
||||||
|
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
|
||||||
|
|
||||||
|
install: all install-lib
|
||||||
@echo installing executable file to $(DESTDIR)$(PREFIX)/bin
|
@echo installing executable file to $(DESTDIR)$(PREFIX)/bin
|
||||||
@mkdir -p $(DESTDIR)$(PREFIX)/bin
|
@mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
@cp -f surf $(DESTDIR)$(PREFIX)/bin
|
@cp -f surf $(DESTDIR)$(PREFIX)/bin
|
||||||
|
@ -57,10 +82,17 @@ install: all
|
||||||
@sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
@sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
@chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
@chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
|
|
||||||
uninstall:
|
uninstall-lib:
|
||||||
|
@echo removing library file from $(DESTDIR)$(LIBPREFIX)
|
||||||
|
@$(LIBTOOL) --mode uninstall rm -f \
|
||||||
|
$(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
|
||||||
|
@- rm -df $(DESTDIR)$(LIBPREFIX)
|
||||||
|
|
||||||
|
uninstall: uninstall-lib
|
||||||
@echo removing executable file from $(DESTDIR)$(PREFIX)/bin
|
@echo removing executable file from $(DESTDIR)$(PREFIX)/bin
|
||||||
@rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
@rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
||||||
@echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
|
@echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
|
||||||
@rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
@rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
|
|
||||||
.PHONY: all options clean dist install uninstall
|
.SUFFIXES: .la .lo .o .c
|
||||||
|
.PHONY: all options clean-dist clean dist install-lib install uninstall-lib uninstall
|
||||||
|
|
12
config.mk
12
config.mk
|
@ -13,16 +13,21 @@ X11LIB = /usr/X11R6/lib
|
||||||
|
|
||||||
GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
|
WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
|
||||||
|
WEBEXTLIB = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
|
||||||
|
|
||||||
# includes and libs
|
# includes and libs
|
||||||
INCS = -I$(X11INC) $(GTKINC)
|
INCS = -I$(X11INC) $(GTKINC)
|
||||||
LIBS = -L$(X11LIB) -lX11 $(GTKLIB) -lgthread-2.0
|
LIBS = -L$(X11LIB) -lX11 $(GTKLIB) -lgthread-2.0
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -DWEBEXTDIR=\"${LIBPREFIX}\" \
|
CPPFLAGS = -DVERSION=\"$(VERSION)\" -DWEBEXTDIR=\"$(LIBPREFIX)\" \
|
||||||
-D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE
|
-D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE
|
||||||
SURF_CFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
|
SURFCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
|
||||||
SURF_LDFLAGS = $(LIBS) $(LDFLAGS)
|
SURFLDFLAGS = $(LIBS) $(LDFLAGS)
|
||||||
|
LIBCPPFLAGS = -DWEBEXTDIR=\"$(LIBPREFIX)\"
|
||||||
|
LIBCFLAGS = $(WEBEXTINC) $(LIBCPPFLAGS) $(CFLAGS)
|
||||||
|
LIBLDFLAGS = $(WEBEXTLIB) $(LDFLAGS)
|
||||||
|
|
||||||
# Solaris
|
# Solaris
|
||||||
#CFLAGS = -fast $(INCS) -DVERSION=\"$(VERSION)\"
|
#CFLAGS = -fast $(INCS) -DVERSION=\"$(VERSION)\"
|
||||||
|
@ -30,3 +35,4 @@ SURF_LDFLAGS = $(LIBS) $(LDFLAGS)
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
#CC = c99
|
#CC = c99
|
||||||
|
LIBTOOL = libtool --quiet
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#include <webkit2/webkit-web-extension.h>
|
||||||
|
|
||||||
|
G_MODULE_EXPORT void
|
||||||
|
webkit_web_extension_initialize(WebKitWebExtension *e)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
Loading…
Reference in New Issue