File: Makefile.sub

package info (click to toggle)
htp 1.19-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,272 kB
  • sloc: ansic: 6,645; perl: 204; makefile: 60
file content (68 lines) | stat: -rw-r--r-- 1,702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# makefile - htp
#
# HTML pre-processor
# Copyright (c) 2002 Jochen Hoenicke
#

p$(dir) := $(d)
d := $(dir)

#################

#
# object files used
#
SRC$(d) := htp.c bool-proc.c def-proc.c defs.c file-proc.c gif.c html.c \
  htp-files.c image-proc.c image.c jpeg.c macro.c misc-proc.c msg.c \
  option.c png.c set-proc.c snprintf.c streams.c suballoc.c textfile.c \
  use-proc.c util.c varstore.c ver.c while-proc.c
HEADERS$(d) := bool-proc.h def-proc.h defs.h file-proc.h gif.h html.h \
  htp-files.h htp.h image-proc.h image.h jpeg.h macro.h misc-proc.h \
  msg.h option.h os.h png.h set-proc.h snprintf.h streams.h suballoc.h \
  textfile.h use-proc.h varstore.h ver.h while-proc.h
SRC$(d)     := $(SRC$(d):%=$(d)/%)
HEADERS$(d) := $(HEADERS$(d):%=$(d)/%)
OBJ$(d)     := $(SRC$(d):%.c=%.$(OBJEXT))

HTP := $(d)/$(MAIN)$(EXEEXT)

DISTDIRS += $(d)
DISTFILES += $(d)/Makefile.sub $(SRC$(d)) $(HEADERS$(d)) $(d)/LICENSE.txt
CLEAN += $(d)/*~ $(d)/*.obj $(d)/*.o $(d)/version.inc $(HTP)

all: $(HTP)

$(d)/version.inc: force
	@echo '#define VER_STRING "$(FULLVERSION)"' > $@.tmp
	@echo '#define PROGRAM_NAME "$(MAIN)"' >> $@.tmp
	-@if ! cmp -s $@.tmp $@; \
	 then mv $@.tmp $@; \
	      echo Updated version number; \
	 else rm $@.tmp; fi

.PHONY: install-bin
install: install-bin

install-bin: $(HTP)
	mkdir -p $(bindir)
	$(INSTALL) -s $(HTP) $(bindir)

#
# explicit dependency: final executable
#
$(HTP) : $(OBJ$(d))
	$(LINK) -o $@ $^ $(LOPT)

#
# implicit dependencies for source code
#
$(OBJ$(d)) : %.$(OBJEXT) : %.c $(d)/version.inc
ifdef WIN32DMC
	cd $(dir $<); $(CC) $(CCOPT) $(DEFINES) $(notdir $<)
else
	$(CC) $(CCOPT) $(DEFINES) -o $*.$(OBJEXT) $<
endif

# restore parent dir
d := $(p$(d))