Remove common
This commit is contained in:
parent
21fcbc004e
commit
8d5e2b3a40
14
Makefile
14
Makefile
|
@ -5,10 +5,8 @@
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
SRC = surf.c
|
SRC = surf.c
|
||||||
CSRC = common.c
|
|
||||||
WSRC = webext-surf.c
|
WSRC = webext-surf.c
|
||||||
OBJ = $(SRC:.c=.o)
|
OBJ = $(SRC:.c=.o)
|
||||||
COBJ = $(CSRC:.c=.o)
|
|
||||||
WOBJ = $(WSRC:.c=.o)
|
WOBJ = $(WSRC:.c=.o)
|
||||||
WLIB = $(WSRC:.c=.so)
|
WLIB = $(WSRC:.c=.so)
|
||||||
|
|
||||||
|
@ -25,23 +23,21 @@ options:
|
||||||
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $<
|
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $<
|
||||||
|
|
||||||
.o.so:
|
.o.so:
|
||||||
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ \
|
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS)
|
||||||
$< $(COBJ) $(WEBEXTLIBS)
|
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
|
|
||||||
$(OBJ) $(COBJ) $(WOBJ): config.h common.h config.mk
|
$(OBJ) $(WOBJ): config.h common.h config.mk
|
||||||
$(WLIB): $(COBJ)
|
|
||||||
|
|
||||||
surf: $(OBJ) $(COBJ)
|
surf: $(OBJ)
|
||||||
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(COBJ) $(LIBS)
|
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||||
|
|
||||||
$(WOBJ):
|
$(WOBJ):
|
||||||
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(@:.o=.c)
|
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(@:.o=.c)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f surf $(OBJ) $(COBJ)
|
rm -f surf $(OBJ)
|
||||||
rm -f $(WLIB) $(WOBJ)
|
rm -f $(WLIB) $(WOBJ)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
15
common.c
15
common.c
|
@ -1,15 +0,0 @@
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
void
|
|
||||||
die(const char *errstr, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, errstr);
|
|
||||||
vfprintf(stderr, errstr, ap);
|
|
||||||
va_end(ap);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
12
surf.c
12
surf.c
|
@ -141,6 +141,7 @@ typedef struct {
|
||||||
} SiteSpecific;
|
} SiteSpecific;
|
||||||
|
|
||||||
/* Surf */
|
/* Surf */
|
||||||
|
static void die(const char *errstr, ...);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
static void setup(void);
|
static void setup(void);
|
||||||
static void sigchld(int unused);
|
static void sigchld(int unused);
|
||||||
|
@ -301,6 +302,17 @@ static ParamName loadfinished[] = {
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
die(const char *errstr, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, errstr);
|
||||||
|
vfprintf(stderr, errstr, ap);
|
||||||
|
va_end(ap);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,8 +26,10 @@ newpage(WebKitWebPage *page)
|
||||||
{
|
{
|
||||||
Page *p;
|
Page *p;
|
||||||
|
|
||||||
if (!(p = calloc(1, sizeof(Page))))
|
if (!(p = calloc(1, sizeof(Page)))) {
|
||||||
die("Cannot malloc!\n");
|
fputs("Cannot malloc!\n", stderr);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
p->next = pages;
|
p->next = pages;
|
||||||
pages = p;
|
pages = p;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user