include config.mk
all: $(TARGET)
-debug: $(DTARGET)
test: $(LIBTARGET)
@$(MAKE) $(MFLAGS) -s -C tests
$(RM) $(DESTDIR)$(MANDIR1)/$(MAN1)
clean: test-clean
- $(RM) src/*.o src/*.do src/*.lo src/hints.js.h
- $(RM) $(TARGET) $(DTARGET)
+ $(RM) src/*.o src/*.lo src/hints.js.h
+ $(RM) $(TARGET)
test-clean:
$(RM) $(LIBTARGET)
$(RM) $(DIST_FILE)
src/hints.o: src/hints.js.h
-src/hints.do: src/hints.js.h
src/hints.lo: src/hints.js.h
src/hints.js.h: src/hints.js
@cat $< | src/js2h.sh > $@
$(OBJ): src/config.h config.mk
-$(DOBJ): src/config.h config.mk
$(LOBJ): src/config.h config.mk
$(TARGET): $(OBJ)
@echo "$(CC) $@"
@$(CC) $(OBJ) -o $@ $(LDFLAGS)
-$(DTARGET): $(DOBJ)
- @echo "$(CC) $@"
- @$(CC) $(DOBJ) -o $@ $(DLDFLAGS)
-
$(LIBTARGET): $(LOBJ)
@echo "$(CC) $@"
@$(CC) -shared ${LOBJ} -o $@ $(LDFLAGS)
@echo "${CC} $@"
@$(CC) $(CFLAGS) -c -o $@ $<
-%.do: %.c %.h
- @echo "${CC} $@"
- @$(CC) $(DFLAGS) -c -o $@ $<
-
%.lo: %.c %.h
@echo "${CC} $@"
- @$(CC) -DTESTLIB $(DFLAGS) -fPIC -c -o $@ $<
+ @$(CC) -DTESTLIB $(CFLAGS) -fPIC -c -o $@ $<
-include $(DEPS)
CFLAGS += ${CPPFLAGS}
LDFLAGS += ${LIBFLAGS}
-# compiler flags for the debug target
-DFLAGS += $(CFLAGS) -ggdb -g -O0
-DLDFLAGS += ${LIBFLAGS}
-
OBJ = $(patsubst %.c, %.o, $(wildcard src/*.c))
-DOBJ = $(patsubst %.c, %.do, $(wildcard src/*.c))
LOBJ = $(patsubst %.c, %.lo, $(wildcard src/*.c))
DEPS = $(OBJ:%.o=%.d)
TARGET = $(PROJECT)
-DTARGET = $(TARGET)_dbg
LIBTARGET = tests/lib$(PROJECT).so
DIST_FILE = $(PROJECT)_$(VERSION).tar.gz
MANDIR1 = $(MANDIR)/man1