File: makefile_nearby.txt

package info (click to toggle)
libjodycode 4.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,676 kB
  • sloc: ansic: 2,820; makefile: 372; sh: 160; xml: 37
file content (39 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download
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
For easy integration of libjodycode into your build process you can use this
code stub to link against a built copy in ../libjodycode; modify as necessary.

COMPILER_OPTIONS should be added to CFLAGS for each object.
LINK_OPTIONS should be added to LDFLAGS for the final link.

Add the static_jc and dynamic_jc rules to be able to build with libjodycode
as a static inclusion or to link to it dynamically.

Add the libjodycode_hint rule and add it to 'all' to tell the user about the
static libjodycode make option.

----- cut here -----

### Find and use nearby libjodycode by default
ifndef IGNORE_NEARBY_JC
 ifneq ("$(wildcard ../libjodycode/libjodycode.h)","")
  $(info Found and using nearby libjodycode at ../libjodycode)
  COMPILER_OPTIONS += -I../libjodycode -L../libjodycode
  ifeq ("$(wildcard ../libjodycode/version.o)","")
   $(error You must build libjodycode before building winregfs)
  endif
 endif
 ifdef FORCE_JC_DLL
  LINK_OPTIONS += -l:../libjodycode/libjodycode.dll
 else
  LINK_OPTIONS += -ljodycode
 endif
endif


dynamic_jc: $(PROGRAM_NAME)
	$(CC) $(CFLAGS) $(OBJS) -Wl,-Bdynamic $(LDFLAGS) -o $(PROGRAM_NAME)$(SUFFIX)

static_jc: $(PROGRAM_NAME)
	$(CC) $(CFLAGS) $(OBJS) -Wl,-Bstatic $(LDFLAGS) -Wl,-Bdynamic -o $(PROGRAM_NAME)$(SUFFIX)

libjodycode_hint:
	$(info hint: if ../libjodycode is built but the program won't run, try doing 'make static_jc')