OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_14/usb_fpga_2_14/trunk

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [capi/] [c/] [Makefile] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
# main targets:
2
#   all             build everything
3
#   clean           clean everything but binaries
4
#   distclean       clean everything
5
 
6
 
7
#########################
8
# configuration section #
9
#########################
10
#OS  operating system (UNIX OR WINDOWS)
11
#default: detected automatically
12
#e.g. OS=UNIX
13
 
14
#GCCEXTRAFLAGS  additional flags
15
GCCEXTRAFLAGS=-Wall
16
#GCCEXTRAFLAGS=-Wall -L/mingw64/lib -I/mingw64/include
17
 
18
###############################
19
# DO NOT CHANGE THE FOLLOWING #
20
###############################
21
.PHONY: all clean distclean
22
 
23
UNIX_TARGETS=ucecho memfifo libztex.so
24
WIN_TARGETS=ucecho.exe memfifo.exe
25
 
26
GCC=gcc -g -std=gnu99  $(GCCEXTRAFLAGS)
27
 
28
ifeq ($(OS),WINDOWS_NT)
29
OS=WINDOWS
30
endif
31
 
32
ifneq ($(OS),WINDOWS)
33
ifneq ($(OS),UNIX)
34
ifeq ($(WINDIR),)
35
OS=UNIX
36
else
37
OS=WINDOWS
38
endif
39
endif
40
endif
41
 
42
ifeq ($(OS),WINDOWS)
43
TARGETS=$(WIN_TARGETS)
44
LIBS=-Wl,-Bstatic -lusb-1.0
45
else
46
TARGETS=$(UNIX_TARGETS)
47
LIBS=-lusb-1.0
48
endif
49
 
50
all: $(TARGETS)
51
 
52
libztex.so: ztex.c ztex.h
53
        $(GCC)-fPIC -shared -o $@ $<
54
 
55
ztex.o: ztex.c ztex.h
56
        $(GCC) -c -o $@ $< $(LIBS)
57
 
58
 
59
%: %.c ztex.o
60
        $(GCC) ztex.o $< $(LIBS) -o $@
61
 
62
%.exe : %.c ztex.o
63
        $(GCC) ztex.o $< $(LIBS) -o $@
64
 
65
clean:
66
        rm -f *.o *.old *.bak *~
67
 
68
distclean: clean
69
        rm -f $(TARGETS)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.