File tree 3 files changed +17
-12
lines changed
3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 3
3
4
4
include config.mk
5
5
include pkgconfig.mk # package version
6
+ include functions.mk
6
7
7
8
# Verbose output?
8
9
V ?= 0
@@ -373,19 +374,18 @@ else
373
374
$(compile)
374
375
endif
375
376
376
- define compile
377
- $(CC ) $(CFLAGS ) -c $< -o $@
378
- endef
379
377
380
378
define create-archive
381
379
$(AR ) q $(ARCHIVE ) $(LIBOBJ )
382
380
$(RANLIB ) $(ARCHIVE )
383
381
endef
384
382
383
+
385
384
define create-library
386
385
$(CC ) $(LDFLAGS ) $(LIBOBJ ) -o $(LIBRARY )
387
386
endef
388
387
388
+
389
389
define generate-pkgcfg
390
390
echo 'Name: capstone' > $(PKGCFGF )
391
391
echo 'Description: Capstone disassembly engine' >> $(PKGCFGF )
@@ -397,6 +397,3 @@ define generate-pkgcfg
397
397
echo 'Cflags: -I$${includedir}' >> $(PKGCFGF )
398
398
endef
399
399
400
- define log
401
- @printf " %-7s %s\n" "$(1 ) " "$(2 ) "
402
- endef
Original file line number Diff line number Diff line change
1
+ # Capstone Disassembly Engine
2
+ # Common functions used by Makefile & tests/Makefile
3
+
4
+ define compile
5
+ ${CC} ${CFLAGS} -c $< -o $@
6
+ endef
7
+
8
+
9
+ define log
10
+ @printf " %-7s %s\n" "$(1 ) " "$(2 ) "
11
+ endef
12
+
Original file line number Diff line number Diff line change 2
2
# By Nguyen Anh Quynh <[email protected] >, 2013-2014
3
3
4
4
include ../config.mk
5
+ include ../functions.mk
5
6
6
7
# Verbose output?
7
8
V ?= 0
@@ -112,20 +113,15 @@ else
112
113
$(compile)
113
114
endif
114
115
115
- define compile
116
- ${CC} ${CFLAGS} -c $< -o $@
117
- endef
118
116
119
117
define link-dynamic
120
118
${CC} $(CFLAGS ) $(LDFLAGS ) $< -O3 -Wall -l$(LIBNAME ) -o $@
121
119
endef
122
120
121
+
123
122
define link-static
124
123
${CC} $(CFLAGS ) $(LDFLAGS ) $< -O3 -Wall $(LIBDIR ) /lib$(LIBNAME ) .$(AR_EXT ) -o $(call staticname,$@ )
125
124
endef
126
125
127
- define log
128
- @printf " %-7s %s\n" "$(1 ) " "$(2 ) "
129
- endef
130
126
131
127
staticname = $(subst $(BIN_EXT ) ,,$(1 ) ) .static$(BIN_EXT )
You can’t perform that action at this time.
0 commit comments